
<!DOCTYPE html>

<html>
  
<!-- Mirrored from docs.sympy.org/latest/modules/polys/domainsref.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:29:01 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>Reference docs for the Poly Domains &#8212; SymPy 1.9 documentation</title>
    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/default.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/graphviz.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/plot_directive.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-core.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-sphinx.css" />
    
    <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
    <script src="../../_static/jquery.js"></script>
    <script src="../../_static/underscore.js"></script>
    <script src="../../_static/doctools.js"></script>
    <script src="../../../../live.sympy.org/static/utilities.js"></script>
    <script src="../../../../live.sympy.org/static/external/classy.js"></script>
    <script src="../../../../live.sympy.org/static/live-core.js"></script>
    <script src="../../../../live.sympy.org/static/live-autocomplete.js"></script>
    <script src="../../../../live.sympy.org/static/live-sphinx.js"></script>
    <script async="async" src="../../../../cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest8331.js?config=TeX-AMS_HTML-full"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["\\(", "\\)"]], "displayMath": [["\\[", "\\]"]]}})</script>
    
    <link rel="shortcut icon" href="../../_static/sympy-notailtext-favicon.ico"/>
    <link href="domainsref.html" rel="canonical" />
    
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="Internals of the Polynomial Manipulation Module" href="internals.html" />
    <link rel="prev" title="Introducing the Domains of the poly module" href="domainsintro.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="internals.html" title="Internals of the Polynomial Manipulation Module"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="domainsintro.html" title="Introducing the Domains of the poly module"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Polynomial Manipulation</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Reference docs for the Poly Domains</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="reference-docs-for-the-poly-domains">
<span id="polys-domainsref"></span><h1>Reference docs for the Poly Domains<a class="headerlink" href="#reference-docs-for-the-poly-domains" title="Permalink to this headline">¶</a></h1>
<p>This page lists the reference documentation for the domains in the polys
module. For a general introduction to the polys module it is recommended to
read <a class="reference internal" href="basics.html#polys-basics"><span class="std std-ref">Basic functionality of the module</span></a> instead. For an introductory explanation of the
what the domain system is and how it is used it is recommended to read
<a class="reference internal" href="domainsintro.html#polys-domainsintro"><span class="std std-ref">Introducing the Domains of the poly module</span></a>. This page lists the reference docs for the
<a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> class and its subclasses (the specific domains such as
<code class="docutils literal notranslate"><span class="pre">ZZ</span></code>) as well as the classes that represent the domain elements.</p>
<section id="domains">
<h2>Domains<a class="headerlink" href="#domains" title="Permalink to this headline">¶</a></h2>
<p>Here we document the various implemented ground domains (see
<a class="reference internal" href="domainsintro.html#polys-domainsintro"><span class="std std-ref">Introducing the Domains of the poly module</span></a> for more of an explanation). There are three types
of <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> subclass: abstract domains, concrete domains, and
“implementation domains”. Abstract domains cannot be (usefully) instantiated
at all, and just collect together functionality shared by many other domains.
Concrete domains are those meant to be instantiated and used in the polynomial
manipulation algorithms. In some cases, there are various possible ways to
implement the data type the domain provides. For example, depending on what
libraries are available on the system, the integers are implemented either
using the python built-in integers, or using gmpy. Note that various aliases
are created automatically depending on the libraries available. As such e.g.
<code class="docutils literal notranslate"><span class="pre">ZZ</span></code> always refers to the most efficient implementation of the integer ring
available.</p>
</section>
<section id="abstract-domains">
<h2>Abstract Domains<a class="headerlink" href="#abstract-domains" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.domain.</span></span><span class="sig-name descname"><span class="pre">Domain</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L15-L1221"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain" title="Permalink to this definition">¶</a></dt>
<dd><p>Superclass for all domains in the polys domains system.</p>
<p>See <a class="reference internal" href="domainsintro.html#polys-domainsintro"><span class="std std-ref">Introducing the Domains of the poly module</span></a> for an introductory explanation of the
domains system.</p>
<p>The <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> class is an abstract base class for all of the
concrete domain types. There are many different <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a>
subclasses each of which has an associated <code class="docutils literal notranslate"><span class="pre">dtype</span></code> which is a class
representing the elements of the domain. The coefficients of a
<a class="reference internal" href="reference.html#sympy.polys.polytools.Poly" title="sympy.polys.polytools.Poly"><code class="xref py py-class docutils literal notranslate"><span class="pre">Poly</span></code></a> are elements of a domain which must be a subclass of
<a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a>.</p>
<p class="rubric">Examples</p>
<p>The most common example domains are the integers <a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a> and the
rationals <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Poly</span><span class="p">,</span> <span class="n">symbols</span><span class="p">,</span> <span class="n">Domain</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;x, y&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">y</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span>
<span class="go">Poly(x**2 + y, x, y, domain=&#39;ZZ&#39;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">.</span><span class="n">domain</span>
<span class="go">ZZ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">isinstance</span><span class="p">(</span><span class="n">p</span><span class="o">.</span><span class="n">domain</span><span class="p">,</span> <span class="n">Domain</span><span class="p">)</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">y</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span>
<span class="go">Poly(x**2 + 1/2*y, x, y, domain=&#39;QQ&#39;)</span>
</pre></div>
</div>
<p>The domains can be used directly in which case the domain object e.g.
(<a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a> or <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a>) can be used as a constructor for elements of
<code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ</span><span class="p">,</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="go">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">dtype</span>  
<span class="go">&lt;class &#39;int&#39;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>  
<span class="go">&lt;class &#39;int&#39;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">1/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="n">QQ</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span>  
<span class="go">&lt;class &#39;sympy.polys.domains.pythonrational.PythonRational&#39;&gt;</span>
</pre></div>
</div>
<p>The corresponding domain elements can be used with the arithmetic
operations <code class="docutils literal notranslate"><span class="pre">+,-,*,**</span></code> and depending on the domain some combination of
<code class="docutils literal notranslate"><span class="pre">/,//,%</span></code> might be usable. For example in <a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a> both <code class="docutils literal notranslate"><span class="pre">//</span></code> (floor
division) and <code class="docutils literal notranslate"><span class="pre">%</span></code> (modulo division) can be used but <code class="docutils literal notranslate"><span class="pre">/</span></code> (true
division) can not. Since <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a> is a <a class="reference internal" href="#sympy.polys.domains.field.Field" title="sympy.polys.domains.field.Field"><code class="xref py py-class docutils literal notranslate"><span class="pre">Field</span></code></a> its elements
can be used with <code class="docutils literal notranslate"><span class="pre">/</span></code> but <code class="docutils literal notranslate"><span class="pre">//</span></code> and <code class="docutils literal notranslate"><span class="pre">%</span></code> should not be used. Some
domains have a <a class="reference internal" href="#sympy.polys.domains.domain.Domain.gcd" title="sympy.polys.domains.domain.Domain.gcd"><code class="xref py py-meth docutils literal notranslate"><span class="pre">gcd()</span></code></a> method.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> <span class="o">+</span> <span class="n">ZZ</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
<span class="go">5</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span> <span class="o">//</span> <span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="go">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span> <span class="o">%</span> <span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span> <span class="o">/</span> <span class="n">QQ</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="go">3/4</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">gcd</span><span class="p">(</span><span class="n">ZZ</span><span class="p">(</span><span class="mi">4</span><span class="p">),</span> <span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">gcd</span><span class="p">(</span><span class="n">QQ</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="mi">7</span><span class="p">),</span> <span class="n">QQ</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span><span class="mi">3</span><span class="p">))</span>
<span class="go">1/21</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">is_Field</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">is_Field</span>
<span class="go">True</span>
</pre></div>
</div>
<p>There are also many other domains including:</p>
<blockquote>
<div><ol class="arabic simple">
<li><p><a class="reference internal" href="#gf-p"><span class="std std-ref">GF(p)</span></a> for finite fields of prime order.</p></li>
<li><p><a class="reference internal" href="#rr"><span class="std std-ref">RR</span></a> for real (floating point) numbers.</p></li>
<li><p><a class="reference internal" href="#cc"><span class="std std-ref">CC</span></a> for complex (floating point) numbers.</p></li>
<li><p><a class="reference internal" href="#qq-a"><span class="std std-ref">QQ&lt;a&gt;</span></a> for algebraic number fields.</p></li>
<li><p><a class="reference internal" href="#k-x"><span class="std std-ref">K[x]</span></a> for polynomial rings.</p></li>
<li><p><a class="reference internal" href="#id11"><span class="std std-ref">K(x)</span></a> for rational function fields.</p></li>
<li><p><a class="reference internal" href="#ex"><span class="std std-ref">EX</span></a> for arbitrary expressions.</p></li>
</ol>
</div></blockquote>
<p>Each domain is represented by a domain object and also an implementation
class (<code class="docutils literal notranslate"><span class="pre">dtype</span></code>) for the elements of the domain. For example the
<a class="reference internal" href="#k-x"><span class="std std-ref">K[x]</span></a> domains are represented by a domain object which is an
instance of <a class="reference internal" href="#sympy.polys.domains.PolynomialRing" title="sympy.polys.domains.PolynomialRing"><code class="xref py py-class docutils literal notranslate"><span class="pre">PolynomialRing</span></code></a> and the elements are always
instances of <a class="reference internal" href="#sympy.polys.rings.PolyElement" title="sympy.polys.rings.PolyElement"><code class="xref py py-class docutils literal notranslate"><span class="pre">PolyElement</span></code></a>. The implementation class
represents particular types of mathematical expressions in a way that is
more efficient than a normal SymPy expression which is of type
<a class="reference internal" href="../core.html#sympy.core.expr.Expr" title="sympy.core.expr.Expr"><code class="xref py py-class docutils literal notranslate"><span class="pre">Expr</span></code></a>. The domain methods <a class="reference internal" href="#sympy.polys.domains.domain.Domain.from_sympy" title="sympy.polys.domains.domain.Domain.from_sympy"><code class="xref py py-meth docutils literal notranslate"><span class="pre">from_sympy()</span></code></a> and
<a class="reference internal" href="#sympy.polys.domains.domain.Domain.to_sympy" title="sympy.polys.domains.domain.Domain.to_sympy"><code class="xref py py-meth docutils literal notranslate"><span class="pre">to_sympy()</span></code></a> are used to convert from <a class="reference internal" href="../core.html#sympy.core.expr.Expr" title="sympy.core.expr.Expr"><code class="xref py py-class docutils literal notranslate"><span class="pre">Expr</span></code></a>
to a domain element and vice versa.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">,</span> <span class="n">Expr</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">ZZ</span><span class="p">[</span><span class="n">x</span><span class="p">]</span>           <span class="c1"># polynomial ring domain</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span>
<span class="go">ZZ[x]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="n">K</span><span class="p">)</span>             <span class="c1"># class of the domain</span>
<span class="go">&lt;class &#39;sympy.polys.domains.polynomialring.PolynomialRing&#39;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">dtype</span>             <span class="c1"># class of the elements</span>
<span class="go">&lt;class &#39;sympy.polys.rings.PolyElement&#39;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p_expr</span> <span class="o">=</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span>   <span class="c1"># Expr</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p_expr</span>
<span class="go">x**2 + 1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="n">p_expr</span><span class="p">)</span>
<span class="go">&lt;class &#39;sympy.core.add.Add&#39;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">isinstance</span><span class="p">(</span><span class="n">p_expr</span><span class="p">,</span> <span class="n">Expr</span><span class="p">)</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p_domain</span> <span class="o">=</span> <span class="n">K</span><span class="o">.</span><span class="n">from_sympy</span><span class="p">(</span><span class="n">p_expr</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p_domain</span>            <span class="c1"># domain element</span>
<span class="go">x**2 + 1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="n">p_domain</span><span class="p">)</span>
<span class="go">&lt;class &#39;sympy.polys.rings.PolyElement&#39;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">to_sympy</span><span class="p">(</span><span class="n">p_domain</span><span class="p">)</span> <span class="o">==</span> <span class="n">p_expr</span>
<span class="go">True</span>
</pre></div>
</div>
<p>The <a class="reference internal" href="#sympy.polys.domains.domain.Domain.convert_from" title="sympy.polys.domains.domain.Domain.convert_from"><code class="xref py py-meth docutils literal notranslate"><span class="pre">convert_from()</span></code></a> method is used to convert domain
elements from one domain to another.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ</span><span class="p">,</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ez</span> <span class="o">=</span> <span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">eq</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">convert_from</span><span class="p">(</span><span class="n">ez</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="n">ez</span><span class="p">)</span>  
<span class="go">&lt;class &#39;int&#39;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="n">eq</span><span class="p">)</span>  
<span class="go">&lt;class &#39;sympy.polys.domains.pythonrational.PythonRational&#39;&gt;</span>
</pre></div>
</div>
<p>Elements from different domains should not be mixed in arithmetic or other
operations: they should be converted to a common domain first.  The domain
method <a class="reference internal" href="#sympy.polys.domains.domain.Domain.unify" title="sympy.polys.domains.domain.Domain.unify"><code class="xref py py-meth docutils literal notranslate"><span class="pre">unify()</span></code></a> is used to find a domain that can
represent all the elements of two given domains.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ</span><span class="p">,</span> <span class="n">QQ</span><span class="p">,</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;x, y&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">unify</span><span class="p">(</span><span class="n">QQ</span><span class="p">)</span>
<span class="go">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="p">[</span><span class="n">x</span><span class="p">]</span><span class="o">.</span><span class="n">unify</span><span class="p">(</span><span class="n">QQ</span><span class="p">)</span>
<span class="go">QQ[x]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="p">[</span><span class="n">x</span><span class="p">]</span><span class="o">.</span><span class="n">unify</span><span class="p">(</span><span class="n">QQ</span><span class="p">[</span><span class="n">y</span><span class="p">])</span>
<span class="go">QQ[x,y]</span>
</pre></div>
</div>
<p>If a domain is a <a class="reference internal" href="#sympy.polys.domains.ring.Ring" title="sympy.polys.domains.ring.Ring"><code class="xref py py-class docutils literal notranslate"><span class="pre">Ring</span></code></a> then is might have an associated
<a class="reference internal" href="#sympy.polys.domains.field.Field" title="sympy.polys.domains.field.Field"><code class="xref py py-class docutils literal notranslate"><span class="pre">Field</span></code></a> and vice versa. The <a class="reference internal" href="#sympy.polys.domains.domain.Domain.get_field" title="sympy.polys.domains.domain.Domain.get_field"><code class="xref py py-meth docutils literal notranslate"><span class="pre">get_field()</span></code></a> and
<a class="reference internal" href="#sympy.polys.domains.domain.Domain.get_ring" title="sympy.polys.domains.domain.Domain.get_ring"><code class="xref py py-meth docutils literal notranslate"><span class="pre">get_ring()</span></code></a> methods will find or create the associated
domain.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ</span><span class="p">,</span> <span class="n">QQ</span><span class="p">,</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">has_assoc_Field</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">get_field</span><span class="p">()</span>
<span class="go">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">has_assoc_Ring</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">get_ring</span><span class="p">()</span>
<span class="go">ZZ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">QQ</span><span class="p">[</span><span class="n">x</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span>
<span class="go">QQ[x]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">get_field</span><span class="p">()</span>
<span class="go">QQ(x)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.polys.domains.domainelement.DomainElement" title="sympy.polys.domains.domainelement.DomainElement"><code class="xref py py-obj docutils literal notranslate"><span class="pre">DomainElement</span></code></a></dt><dd><p>abstract base class for domain elements</p>
</dd>
<dt><a class="reference internal" href="reference.html#sympy.polys.constructor.construct_domain" title="sympy.polys.constructor.construct_domain"><code class="xref py py-obj docutils literal notranslate"><span class="pre">construct_domain</span></code></a></dt><dd><p>construct a minimal domain for some expressions</p>
</dd>
</dl>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.abs">
<span class="sig-name descname"><span class="pre">abs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L928-L930"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.abs" title="Permalink to this definition">¶</a></dt>
<dd><p>Absolute value of <code class="docutils literal notranslate"><span class="pre">a</span></code>, implies <code class="docutils literal notranslate"><span class="pre">__abs__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.add">
<span class="sig-name descname"><span class="pre">add</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L940-L942"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.add" title="Permalink to this definition">¶</a></dt>
<dd><p>Sum of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies <code class="docutils literal notranslate"><span class="pre">__add__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.algebraic_field">
<span class="sig-name descname"><span class="pre">algebraic_field</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">extension</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L884-L886"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.algebraic_field" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an algebraic field, i.e. <span class="math notranslate nohighlight">\(K(\alpha, \ldots)\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.almosteq">
<span class="sig-name descname"><span class="pre">almosteq</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tolerance</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L1215-L1217"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.almosteq" title="Permalink to this definition">¶</a></dt>
<dd><p>Check if <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code> are almost equal.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.characteristic">
<span class="sig-name descname"><span class="pre">characteristic</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L1219-L1221"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.characteristic" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the characteristic of this domain.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.cofactors">
<span class="sig-name descname"><span class="pre">cofactors</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L1180-L1185"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.cofactors" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns GCD and cofactors of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.convert">
<span class="sig-name descname"><span class="pre">convert</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">base</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L410-L467"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.convert" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">element</span></code> to <code class="docutils literal notranslate"><span class="pre">self.dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.convert_from">
<span class="sig-name descname"><span class="pre">convert_from</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">base</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L393-L408"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.convert_from" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">element</span></code> to <code class="docutils literal notranslate"><span class="pre">self.dtype</span></code> given the base domain.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.denom">
<span class="sig-name descname"><span class="pre">denom</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L1167-L1169"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.denom" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns denominator of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.div">
<span class="sig-name descname"><span class="pre">div</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L1069-L1153"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.div" title="Permalink to this definition">¶</a></dt>
<dd><p>Quotient and remainder for <em>a</em> and <em>b</em>. Analogue of <code class="docutils literal notranslate"><span class="pre">divmod(a,</span> <span class="pre">b)</span></code></p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>a: domain element</strong></p>
<blockquote>
<div><p>The dividend</p>
</div></blockquote>
<p><strong>b: domain element</strong></p>
<blockquote>
<div><p>The divisor</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>(q, r): tuple of domain elements</p>
<blockquote>
<div><p>The quotient and remainder</p>
</div></blockquote>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ZeroDivisionError: when the divisor is zero.</strong></p>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>This is essentially the same as <code class="docutils literal notranslate"><span class="pre">divmod(a,</span> <span class="pre">b)</span></code> except that is more
consistent when working over some <a class="reference internal" href="#sympy.polys.domains.field.Field" title="sympy.polys.domains.field.Field"><code class="xref py py-class docutils literal notranslate"><span class="pre">Field</span></code></a> domains such as
<a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a>. When working over an arbitrary <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> the
<a class="reference internal" href="#sympy.polys.domains.domain.Domain.div" title="sympy.polys.domains.domain.Domain.div"><code class="xref py py-meth docutils literal notranslate"><span class="pre">div()</span></code></a> method should be used instead of <code class="docutils literal notranslate"><span class="pre">divmod</span></code>.</p>
<p>The key invariant is that if <code class="docutils literal notranslate"><span class="pre">q,</span> <span class="pre">r</span> <span class="pre">=</span> <span class="pre">K.div(a,</span> <span class="pre">b)</span></code> then
<code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">==</span> <span class="pre">b*q</span> <span class="pre">+</span> <span class="pre">r</span></code>.</p>
<p>The result of <code class="docutils literal notranslate"><span class="pre">K.div(a,</span> <span class="pre">b)</span></code> is the same as the tuple
<code class="docutils literal notranslate"><span class="pre">(K.quo(a,</span> <span class="pre">b),</span> <span class="pre">K.rem(a,</span> <span class="pre">b))</span></code> except that if both quotient and
remainder are needed then it is more efficient to use
<a class="reference internal" href="#sympy.polys.domains.domain.Domain.div" title="sympy.polys.domains.domain.Domain.div"><code class="xref py py-meth docutils literal notranslate"><span class="pre">div()</span></code></a>.</p>
<p class="rubric">Examples</p>
<p>We can use <code class="docutils literal notranslate"><span class="pre">K.div</span></code> instead of <code class="docutils literal notranslate"><span class="pre">divmod</span></code> for floor division and
remainder.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ</span><span class="p">,</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">div</span><span class="p">(</span><span class="n">ZZ</span><span class="p">(</span><span class="mi">5</span><span class="p">),</span> <span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">(2, 1)</span>
</pre></div>
</div>
<p>If <code class="docutils literal notranslate"><span class="pre">K</span></code> is a <a class="reference internal" href="#sympy.polys.domains.field.Field" title="sympy.polys.domains.field.Field"><code class="xref py py-class docutils literal notranslate"><span class="pre">Field</span></code></a> then the division is always exact
with a remainder of <a class="reference internal" href="#sympy.polys.domains.domain.Domain.zero" title="sympy.polys.domains.domain.Domain.zero"><code class="xref py py-attr docutils literal notranslate"><span class="pre">zero</span></code></a>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">div</span><span class="p">(</span><span class="n">QQ</span><span class="p">(</span><span class="mi">5</span><span class="p">),</span> <span class="n">QQ</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">(5/2, 0)</span>
</pre></div>
</div>
<p class="rubric">Notes</p>
<p>If <code class="docutils literal notranslate"><span class="pre">gmpy</span></code> is installed then the <code class="docutils literal notranslate"><span class="pre">gmpy.mpq</span></code> type will be used as
the <a class="reference internal" href="#sympy.polys.domains.domain.Domain.dtype" title="sympy.polys.domains.domain.Domain.dtype"><code class="xref py py-attr docutils literal notranslate"><span class="pre">dtype</span></code></a> for <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a>. The <code class="docutils literal notranslate"><span class="pre">gmpy.mpq</span></code> type
defines <code class="docutils literal notranslate"><span class="pre">divmod</span></code> in a way that is undesirable so
<a class="reference internal" href="#sympy.polys.domains.domain.Domain.div" title="sympy.polys.domains.domain.Domain.div"><code class="xref py py-meth docutils literal notranslate"><span class="pre">div()</span></code></a> should be used instead of <code class="docutils literal notranslate"><span class="pre">divmod</span></code>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">QQ</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span> <span class="o">=</span> <span class="n">QQ</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span>               
<span class="go">mpq(1,1)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span>               
<span class="go">mpq(3,2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">divmod</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span>    
<span class="go">(mpz(0), mpq(1,1))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">div</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span>    
<span class="go">(mpq(2,3), mpq(0,1))</span>
</pre></div>
</div>
<p>Using <code class="docutils literal notranslate"><span class="pre">//</span></code> or <code class="docutils literal notranslate"><span class="pre">%</span></code> with <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a> will lead to incorrect results so
<a class="reference internal" href="#sympy.polys.domains.domain.Domain.div" title="sympy.polys.domains.domain.Domain.div"><code class="xref py py-meth docutils literal notranslate"><span class="pre">div()</span></code></a> should be used instead.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.polys.domains.domain.Domain.quo" title="sympy.polys.domains.domain.Domain.quo"><code class="xref py py-obj docutils literal notranslate"><span class="pre">quo</span></code></a></dt><dd><p>Analogue of <code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">//</span> <span class="pre">b</span></code></p>
</dd>
<dt><a class="reference internal" href="#sympy.polys.domains.domain.Domain.rem" title="sympy.polys.domains.domain.Domain.rem"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rem</span></code></a></dt><dd><p>Analogue of <code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">%</span> <span class="pre">b</span></code></p>
</dd>
<dt><a class="reference internal" href="#sympy.polys.domains.domain.Domain.exquo" title="sympy.polys.domains.domain.Domain.exquo"><code class="xref py py-obj docutils literal notranslate"><span class="pre">exquo</span></code></a></dt><dd><p>Analogue of <code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">/</span> <span class="pre">b</span></code></p>
</dd>
</dl>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.drop">
<span class="sig-name descname"><span class="pre">drop</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">symbols</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L892-L896"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.drop" title="Permalink to this definition">¶</a></dt>
<dd><p>Drop generators from this domain.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.dtype">
<span class="sig-name descname"><span class="pre">dtype</span></span><em class="property"><span class="pre">:</span> <span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Type</span><span class="p"><span class="pre">]</span></span></em><em class="property"> <span class="pre">=</span> <span class="pre">None</span></em><a class="headerlink" href="#sympy.polys.domains.domain.Domain.dtype" title="Permalink to this definition">¶</a></dt>
<dd><p>The type (class) of the elements of this <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ</span><span class="p">,</span> <span class="n">QQ</span><span class="p">,</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">dtype</span>
<span class="go">&lt;class &#39;int&#39;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z</span> <span class="o">=</span> <span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z</span>
<span class="go">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">&lt;class &#39;int&#39;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="n">z</span><span class="p">)</span> <span class="o">==</span> <span class="n">ZZ</span><span class="o">.</span><span class="n">dtype</span>
<span class="go">True</span>
</pre></div>
</div>
<p>Every domain has an associated <strong>dtype</strong> (“datatype”) which is the
class of the associated domain elements.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.polys.domains.domain.Domain.of_type" title="sympy.polys.domains.domain.Domain.of_type"><code class="xref py py-obj docutils literal notranslate"><span class="pre">of_type</span></code></a></p>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.evalf">
<span class="sig-name descname"><span class="pre">evalf</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prec</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">options</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L1203-L1205"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.evalf" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns numerical approximation of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.exquo">
<span class="sig-name descname"><span class="pre">exquo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L956-L1037"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.exquo" title="Permalink to this definition">¶</a></dt>
<dd><p>Exact quotient of <em>a</em> and <em>b</em>. Analogue of <code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">/</span> <span class="pre">b</span></code>.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>a: domain element</strong></p>
<blockquote>
<div><p>The dividend</p>
</div></blockquote>
<p><strong>b: domain element</strong></p>
<blockquote>
<div><p>The divisor</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>q: domain element</p>
<blockquote>
<div><p>The exact quotient</p>
</div></blockquote>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ExactQuotientFailed: if exact division is not possible.</strong></p>
<p><strong>ZeroDivisionError: when the divisor is zero.</strong></p>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>This is essentially the same as <code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">/</span> <span class="pre">b</span></code> except that an error will be
raised if the division is inexact (if there is any remainder) and the
result will always be a domain element. When working in a
<a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> that is not a <a class="reference internal" href="#sympy.polys.domains.field.Field" title="sympy.polys.domains.field.Field"><code class="xref py py-class docutils literal notranslate"><span class="pre">Field</span></code></a> (e.g. <a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a>
or <a class="reference internal" href="#k-x"><span class="std std-ref">K[x]</span></a>) <code class="docutils literal notranslate"><span class="pre">exquo</span></code> should be used instead of <code class="docutils literal notranslate"><span class="pre">/</span></code>.</p>
<p>The key invariant is that if <code class="docutils literal notranslate"><span class="pre">q</span> <span class="pre">=</span> <span class="pre">K.exquo(a,</span> <span class="pre">b)</span></code> (and <code class="docutils literal notranslate"><span class="pre">exquo</span></code> does
not raise an exception) then <code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">==</span> <span class="pre">b*q</span></code>.</p>
<p class="rubric">Examples</p>
<p>We can use <code class="docutils literal notranslate"><span class="pre">K.exquo</span></code> instead of <code class="docutils literal notranslate"><span class="pre">/</span></code> for exact division.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">exquo</span><span class="p">(</span><span class="n">ZZ</span><span class="p">(</span><span class="mi">4</span><span class="p">),</span> <span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">exquo</span><span class="p">(</span><span class="n">ZZ</span><span class="p">(</span><span class="mi">5</span><span class="p">),</span> <span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="gt">Traceback (most recent call last):</span>
    <span class="o">...</span>
<span class="gr">ExactQuotientFailed</span>: <span class="n">2 does not divide 5 in ZZ</span>
</pre></div>
</div>
<p>Over a <a class="reference internal" href="#sympy.polys.domains.field.Field" title="sympy.polys.domains.field.Field"><code class="xref py py-class docutils literal notranslate"><span class="pre">Field</span></code></a> such as <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a>, division (with nonzero
divisor) is always exact so in that case <code class="docutils literal notranslate"><span class="pre">/</span></code> can be used instead of
<a class="reference internal" href="#sympy.polys.domains.domain.Domain.exquo" title="sympy.polys.domains.domain.Domain.exquo"><code class="xref py py-meth docutils literal notranslate"><span class="pre">exquo()</span></code></a>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">exquo</span><span class="p">(</span><span class="n">QQ</span><span class="p">(</span><span class="mi">5</span><span class="p">),</span> <span class="n">QQ</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">5/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span> <span class="o">/</span> <span class="n">QQ</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="go">5/2</span>
</pre></div>
</div>
<p class="rubric">Notes</p>
<p>Since the default <a class="reference internal" href="#sympy.polys.domains.domain.Domain.dtype" title="sympy.polys.domains.domain.Domain.dtype"><code class="xref py py-attr docutils literal notranslate"><span class="pre">dtype</span></code></a> for <a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a> is <code class="docutils literal notranslate"><span class="pre">int</span></code>
(or <code class="docutils literal notranslate"><span class="pre">mpz</span></code>) division as <code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">/</span> <span class="pre">b</span></code> should not be used as it would give
a <code class="docutils literal notranslate"><span class="pre">float</span></code>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span> <span class="o">/</span> <span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="go">2.0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span> <span class="o">/</span> <span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="go">2.5</span>
</pre></div>
</div>
<p>Using <code class="docutils literal notranslate"><span class="pre">/</span></code> with <a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a> will lead to incorrect results so
<a class="reference internal" href="#sympy.polys.domains.domain.Domain.exquo" title="sympy.polys.domains.domain.Domain.exquo"><code class="xref py py-meth docutils literal notranslate"><span class="pre">exquo()</span></code></a> should be used instead.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.polys.domains.domain.Domain.quo" title="sympy.polys.domains.domain.Domain.quo"><code class="xref py py-obj docutils literal notranslate"><span class="pre">quo</span></code></a></dt><dd><p>Analogue of <code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">//</span> <span class="pre">b</span></code></p>
</dd>
<dt><a class="reference internal" href="#sympy.polys.domains.domain.Domain.rem" title="sympy.polys.domains.domain.Domain.rem"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rem</span></code></a></dt><dd><p>Analogue of <code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">%</span> <span class="pre">b</span></code></p>
</dd>
<dt><a class="reference internal" href="#sympy.polys.domains.domain.Domain.div" title="sympy.polys.domains.domain.Domain.div"><code class="xref py py-obj docutils literal notranslate"><span class="pre">div</span></code></a></dt><dd><p>Analogue of <code class="docutils literal notranslate"><span class="pre">divmod(a,</span> <span class="pre">b)</span></code></p>
</dd>
</dl>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.frac_field">
<span class="sig-name descname"><span class="pre">frac_field</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">symbols</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">LexOrder()</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L869-L872"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.frac_field" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a fraction field, i.e. <span class="math notranslate nohighlight">\(K(X)\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.from_AlgebraicField">
<span class="sig-name descname"><span class="pre">from_AlgebraicField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L644-L646"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.from_AlgebraicField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert an algebraic number to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.from_ComplexField">
<span class="sig-name descname"><span class="pre">from_ComplexField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L640-L642"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.from_ComplexField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a complex element to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.from_ExpressionDomain">
<span class="sig-name descname"><span class="pre">from_ExpressionDomain</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L661-L663"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.from_ExpressionDomain" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a <code class="docutils literal notranslate"><span class="pre">EX</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.from_ExpressionRawDomain">
<span class="sig-name descname"><span class="pre">from_ExpressionRawDomain</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L665-L667"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.from_ExpressionRawDomain" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a <code class="docutils literal notranslate"><span class="pre">EX</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.from_FF">
<span class="sig-name descname"><span class="pre">from_FF</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L608-L610"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.from_FF" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">ModularInteger(int)</span></code> to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.from_FF_gmpy">
<span class="sig-name descname"><span class="pre">from_FF_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L624-L626"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.from_FF_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">ModularInteger(mpz)</span></code> to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.from_FF_python">
<span class="sig-name descname"><span class="pre">from_FF_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L612-L614"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.from_FF_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">ModularInteger(int)</span></code> to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.from_FractionField">
<span class="sig-name descname"><span class="pre">from_FractionField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L653-L655"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.from_FractionField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a rational function to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.from_GlobalPolynomialRing">
<span class="sig-name descname"><span class="pre">from_GlobalPolynomialRing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L669-L672"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.from_GlobalPolynomialRing" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a polynomial to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.from_MonogenicFiniteExtension">
<span class="sig-name descname"><span class="pre">from_MonogenicFiniteExtension</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L657-L659"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.from_MonogenicFiniteExtension" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert an <code class="docutils literal notranslate"><span class="pre">ExtensionElement</span></code> to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.from_PolynomialRing">
<span class="sig-name descname"><span class="pre">from_PolynomialRing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L648-L651"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.from_PolynomialRing" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a polynomial to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.from_QQ_gmpy">
<span class="sig-name descname"><span class="pre">from_QQ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L632-L634"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.from_QQ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a GMPY <code class="docutils literal notranslate"><span class="pre">mpq</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.from_QQ_python">
<span class="sig-name descname"><span class="pre">from_QQ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L620-L622"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.from_QQ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">Fraction</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.from_RealField">
<span class="sig-name descname"><span class="pre">from_RealField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L636-L638"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.from_RealField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a real element object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.from_ZZ_gmpy">
<span class="sig-name descname"><span class="pre">from_ZZ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L628-L630"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.from_ZZ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a GMPY <code class="docutils literal notranslate"><span class="pre">mpz</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.from_ZZ_python">
<span class="sig-name descname"><span class="pre">from_ZZ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L616-L618"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.from_ZZ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">int</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.from_sympy">
<span class="sig-name descname"><span class="pre">from_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L577-L603"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.from_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a SymPy expression to an element of this domain.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>expr: Expr</strong></p>
<blockquote>
<div><p>A normal sympy expression of type <a class="reference internal" href="../core.html#sympy.core.expr.Expr" title="sympy.core.expr.Expr"><code class="xref py py-class docutils literal notranslate"><span class="pre">Expr</span></code></a>.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a: domain element</p>
<blockquote>
<div><p>An element of this <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a>.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>See <a class="reference internal" href="#sympy.polys.domains.domain.Domain.to_sympy" title="sympy.polys.domains.domain.Domain.to_sympy"><code class="xref py py-meth docutils literal notranslate"><span class="pre">to_sympy()</span></code></a> for explanation and examples.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.polys.domains.domain.Domain.to_sympy" title="sympy.polys.domains.domain.Domain.to_sympy"><code class="xref py py-obj docutils literal notranslate"><span class="pre">to_sympy</span></code></a>, <a class="reference internal" href="#sympy.polys.domains.domain.Domain.convert_from" title="sympy.polys.domains.domain.Domain.convert_from"><code class="xref py py-obj docutils literal notranslate"><span class="pre">convert_from</span></code></a></p>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.gcd">
<span class="sig-name descname"><span class="pre">gcd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L1187-L1189"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.gcd" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns GCD of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.gcdex">
<span class="sig-name descname"><span class="pre">gcdex</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L1176-L1178"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.gcdex" title="Permalink to this definition">¶</a></dt>
<dd><p>Extended GCD of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.get_exact">
<span class="sig-name descname"><span class="pre">get_exact</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L853-L855"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.get_exact" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an exact domain associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.get_field">
<span class="sig-name descname"><span class="pre">get_field</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L849-L851"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.get_field" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a field associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.get_ring">
<span class="sig-name descname"><span class="pre">get_ring</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L845-L847"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.get_ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a ring associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.half_gcdex">
<span class="sig-name descname"><span class="pre">half_gcdex</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L1171-L1174"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.half_gcdex" title="Permalink to this definition">¶</a></dt>
<dd><p>Half extended GCD of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.has_assoc_Field">
<span class="sig-name descname"><span class="pre">has_assoc_Field</span></span><em class="property"> <span class="pre">=</span> <span class="pre">False</span></em><a class="headerlink" href="#sympy.polys.domains.domain.Domain.has_assoc_Field" title="Permalink to this definition">¶</a></dt>
<dd><p>Boolean flag indicating if the domain has an associated
<a class="reference internal" href="#sympy.polys.domains.field.Field" title="sympy.polys.domains.field.Field"><code class="xref py py-class docutils literal notranslate"><span class="pre">Field</span></code></a>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">has_assoc_Field</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">get_field</span><span class="p">()</span>
<span class="go">QQ</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.polys.domains.domain.Domain.is_Field" title="sympy.polys.domains.domain.Domain.is_Field"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_Field</span></code></a>, <a class="reference internal" href="#sympy.polys.domains.domain.Domain.get_field" title="sympy.polys.domains.domain.Domain.get_field"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_field</span></code></a></p>
</div>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.has_assoc_Ring">
<span class="sig-name descname"><span class="pre">has_assoc_Ring</span></span><em class="property"> <span class="pre">=</span> <span class="pre">False</span></em><a class="headerlink" href="#sympy.polys.domains.domain.Domain.has_assoc_Ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Boolean flag indicating if the domain has an associated
<a class="reference internal" href="#sympy.polys.domains.ring.Ring" title="sympy.polys.domains.ring.Ring"><code class="xref py py-class docutils literal notranslate"><span class="pre">Ring</span></code></a>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">has_assoc_Ring</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">get_ring</span><span class="p">()</span>
<span class="go">ZZ</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.polys.domains.domain.Domain.is_Field" title="sympy.polys.domains.domain.Domain.is_Field"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_Field</span></code></a>, <a class="reference internal" href="#sympy.polys.domains.domain.Domain.get_ring" title="sympy.polys.domains.domain.Domain.get_ring"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_ring</span></code></a></p>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.inject">
<span class="sig-name descname"><span class="pre">inject</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">symbols</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L888-L890"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.inject" title="Permalink to this definition">¶</a></dt>
<dd><p>Inject generators into this domain.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.invert">
<span class="sig-name descname"><span class="pre">invert</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L1155-L1157"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.invert" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns inversion of <code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">mod</span> <span class="pre">b</span></code>, implies something.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.is_Field">
<span class="sig-name descname"><span class="pre">is_Field</span></span><em class="property"> <span class="pre">=</span> <span class="pre">False</span></em><a class="headerlink" href="#sympy.polys.domains.domain.Domain.is_Field" title="Permalink to this definition">¶</a></dt>
<dd><p>Boolean flag indicating if the domain is a <a class="reference internal" href="#sympy.polys.domains.field.Field" title="sympy.polys.domains.field.Field"><code class="xref py py-class docutils literal notranslate"><span class="pre">Field</span></code></a>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ</span><span class="p">,</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">is_Field</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">is_Field</span>
<span class="go">True</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.polys.domains.domain.Domain.is_PID" title="sympy.polys.domains.domain.Domain.is_PID"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_PID</span></code></a>, <a class="reference internal" href="#sympy.polys.domains.domain.Domain.is_Ring" title="sympy.polys.domains.domain.Domain.is_Ring"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_Ring</span></code></a>, <a class="reference internal" href="#sympy.polys.domains.domain.Domain.get_field" title="sympy.polys.domains.domain.Domain.get_field"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_field</span></code></a>, <a class="reference internal" href="#sympy.polys.domains.domain.Domain.has_assoc_Field" title="sympy.polys.domains.domain.Domain.has_assoc_Field"><code class="xref py py-obj docutils literal notranslate"><span class="pre">has_assoc_Field</span></code></a></p>
</div>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.is_PID">
<span class="sig-name descname"><span class="pre">is_PID</span></span><em class="property"> <span class="pre">=</span> <span class="pre">False</span></em><a class="headerlink" href="#sympy.polys.domains.domain.Domain.is_PID" title="Permalink to this definition">¶</a></dt>
<dd><p>Boolean flag indicating if the domain is a <a class="reference external" href="https://en.wikipedia.org/wiki/Principal_ideal_domain">principal ideal domain</a>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">has_assoc_Field</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">get_field</span><span class="p">()</span>
<span class="go">QQ</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.polys.domains.domain.Domain.is_Field" title="sympy.polys.domains.domain.Domain.is_Field"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_Field</span></code></a>, <a class="reference internal" href="#sympy.polys.domains.domain.Domain.get_field" title="sympy.polys.domains.domain.Domain.get_field"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_field</span></code></a></p>
</div>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.is_Ring">
<span class="sig-name descname"><span class="pre">is_Ring</span></span><em class="property"> <span class="pre">=</span> <span class="pre">False</span></em><a class="headerlink" href="#sympy.polys.domains.domain.Domain.is_Ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Boolean flag indicating if the domain is a <a class="reference internal" href="#sympy.polys.domains.ring.Ring" title="sympy.polys.domains.ring.Ring"><code class="xref py py-class docutils literal notranslate"><span class="pre">Ring</span></code></a>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">is_Ring</span>
<span class="go">True</span>
</pre></div>
</div>
<p>Basically every <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> represents a ring so this flag is
not that useful.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.polys.domains.domain.Domain.is_PID" title="sympy.polys.domains.domain.Domain.is_PID"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_PID</span></code></a>, <a class="reference internal" href="#sympy.polys.domains.domain.Domain.is_Field" title="sympy.polys.domains.domain.Domain.is_Field"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_Field</span></code></a>, <a class="reference internal" href="#sympy.polys.domains.domain.Domain.get_ring" title="sympy.polys.domains.domain.Domain.get_ring"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_ring</span></code></a>, <a class="reference internal" href="#sympy.polys.domains.domain.Domain.has_assoc_Ring" title="sympy.polys.domains.domain.Domain.has_assoc_Ring"><code class="xref py py-obj docutils literal notranslate"><span class="pre">has_assoc_Ring</span></code></a></p>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.is_negative">
<span class="sig-name descname"><span class="pre">is_negative</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L910-L912"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.is_negative" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">a</span></code> is negative.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.is_nonnegative">
<span class="sig-name descname"><span class="pre">is_nonnegative</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L918-L920"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.is_nonnegative" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">a</span></code> is non-negative.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.is_nonpositive">
<span class="sig-name descname"><span class="pre">is_nonpositive</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L914-L916"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.is_nonpositive" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">a</span></code> is non-positive.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.is_one">
<span class="sig-name descname"><span class="pre">is_one</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L902-L904"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.is_one" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">a</span></code> is one.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.is_positive">
<span class="sig-name descname"><span class="pre">is_positive</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L906-L908"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.is_positive" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">a</span></code> is positive.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.is_zero">
<span class="sig-name descname"><span class="pre">is_zero</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L898-L900"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.is_zero" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">a</span></code> is zero.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.lcm">
<span class="sig-name descname"><span class="pre">lcm</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L1191-L1193"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.lcm" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns LCM of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.log">
<span class="sig-name descname"><span class="pre">log</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L1195-L1197"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.log" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns b-base logarithm of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.map">
<span class="sig-name descname"><span class="pre">map</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">seq</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L833-L843"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.map" title="Permalink to this definition">¶</a></dt>
<dd><p>Rersively apply <code class="docutils literal notranslate"><span class="pre">self</span></code> to all elements of <code class="docutils literal notranslate"><span class="pre">seq</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.mul">
<span class="sig-name descname"><span class="pre">mul</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L948-L950"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.mul" title="Permalink to this definition">¶</a></dt>
<dd><p>Product of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies <code class="docutils literal notranslate"><span class="pre">__mul__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.n">
<span class="sig-name descname"><span class="pre">n</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prec</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">options</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L1203-L1205"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.n" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns numerical approximation of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.neg">
<span class="sig-name descname"><span class="pre">neg</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L932-L934"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.neg" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">a</span></code> negated, implies <code class="docutils literal notranslate"><span class="pre">__neg__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.numer">
<span class="sig-name descname"><span class="pre">numer</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L1163-L1165"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.numer" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns numerator of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.of_type">
<span class="sig-name descname"><span class="pre">of_type</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L469-L471"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.of_type" title="Permalink to this definition">¶</a></dt>
<dd><p>Check if <code class="docutils literal notranslate"><span class="pre">a</span></code> is of type <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.old_frac_field">
<span class="sig-name descname"><span class="pre">old_frac_field</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">symbols</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L879-L882"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.old_frac_field" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a fraction field, i.e. <span class="math notranslate nohighlight">\(K(X)\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.old_poly_ring">
<span class="sig-name descname"><span class="pre">old_poly_ring</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">symbols</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L874-L877"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.old_poly_ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a polynomial ring, i.e. <span class="math notranslate nohighlight">\(K[X]\)</span>.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.one">
<span class="sig-name descname"><span class="pre">one</span></span><em class="property"><span class="pre">:</span> <span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Any</span><span class="p"><span class="pre">]</span></span></em><em class="property"> <span class="pre">=</span> <span class="pre">None</span></em><a class="headerlink" href="#sympy.polys.domains.domain.Domain.one" title="Permalink to this definition">¶</a></dt>
<dd><p>The one element of the <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">one</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">of_type</span><span class="p">(</span><span class="n">QQ</span><span class="o">.</span><span class="n">one</span><span class="p">)</span>
<span class="go">True</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.polys.domains.domain.Domain.of_type" title="sympy.polys.domains.domain.Domain.of_type"><code class="xref py py-obj docutils literal notranslate"><span class="pre">of_type</span></code></a>, <a class="reference internal" href="#sympy.polys.domains.domain.Domain.zero" title="sympy.polys.domains.domain.Domain.zero"><code class="xref py py-obj docutils literal notranslate"><span class="pre">zero</span></code></a></p>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.poly_ring">
<span class="sig-name descname"><span class="pre">poly_ring</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">symbols</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">LexOrder()</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L864-L867"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.poly_ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a polynomial ring, i.e. <span class="math notranslate nohighlight">\(K[X]\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.pos">
<span class="sig-name descname"><span class="pre">pos</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L936-L938"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.pos" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">a</span></code> positive, implies <code class="docutils literal notranslate"><span class="pre">__pos__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.pow">
<span class="sig-name descname"><span class="pre">pow</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L952-L954"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.pow" title="Permalink to this definition">¶</a></dt>
<dd><p>Raise <code class="docutils literal notranslate"><span class="pre">a</span></code> to power <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies <code class="docutils literal notranslate"><span class="pre">__pow__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.quo">
<span class="sig-name descname"><span class="pre">quo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L1039-L1052"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.quo" title="Permalink to this definition">¶</a></dt>
<dd><p>Quotient of <em>a</em> and <em>b</em>. Analogue of <code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">//</span> <span class="pre">b</span></code>.</p>
<p><code class="docutils literal notranslate"><span class="pre">K.quo(a,</span> <span class="pre">b)</span></code> is equivalent to <code class="docutils literal notranslate"><span class="pre">K.div(a,</span> <span class="pre">b)[0]</span></code>. See
<a class="reference internal" href="#sympy.polys.domains.domain.Domain.div" title="sympy.polys.domains.domain.Domain.div"><code class="xref py py-meth docutils literal notranslate"><span class="pre">div()</span></code></a> for more explanation.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.polys.domains.domain.Domain.rem" title="sympy.polys.domains.domain.Domain.rem"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rem</span></code></a></dt><dd><p>Analogue of <code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">%</span> <span class="pre">b</span></code></p>
</dd>
<dt><a class="reference internal" href="#sympy.polys.domains.domain.Domain.div" title="sympy.polys.domains.domain.Domain.div"><code class="xref py py-obj docutils literal notranslate"><span class="pre">div</span></code></a></dt><dd><p>Analogue of <code class="docutils literal notranslate"><span class="pre">divmod(a,</span> <span class="pre">b)</span></code></p>
</dd>
<dt><a class="reference internal" href="#sympy.polys.domains.domain.Domain.exquo" title="sympy.polys.domains.domain.Domain.exquo"><code class="xref py py-obj docutils literal notranslate"><span class="pre">exquo</span></code></a></dt><dd><p>Analogue of <code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">/</span> <span class="pre">b</span></code></p>
</dd>
</dl>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.rem">
<span class="sig-name descname"><span class="pre">rem</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L1054-L1067"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.rem" title="Permalink to this definition">¶</a></dt>
<dd><p>Modulo division of <em>a</em> and <em>b</em>. Analogue of <code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">%</span> <span class="pre">b</span></code>.</p>
<p><code class="docutils literal notranslate"><span class="pre">K.rem(a,</span> <span class="pre">b)</span></code> is equivalent to <code class="docutils literal notranslate"><span class="pre">K.div(a,</span> <span class="pre">b)[1]</span></code>. See
<a class="reference internal" href="#sympy.polys.domains.domain.Domain.div" title="sympy.polys.domains.domain.Domain.div"><code class="xref py py-meth docutils literal notranslate"><span class="pre">div()</span></code></a> for more explanation.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.polys.domains.domain.Domain.quo" title="sympy.polys.domains.domain.Domain.quo"><code class="xref py py-obj docutils literal notranslate"><span class="pre">quo</span></code></a></dt><dd><p>Analogue of <code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">//</span> <span class="pre">b</span></code></p>
</dd>
<dt><a class="reference internal" href="#sympy.polys.domains.domain.Domain.div" title="sympy.polys.domains.domain.Domain.div"><code class="xref py py-obj docutils literal notranslate"><span class="pre">div</span></code></a></dt><dd><p>Analogue of <code class="docutils literal notranslate"><span class="pre">divmod(a,</span> <span class="pre">b)</span></code></p>
</dd>
<dt><a class="reference internal" href="#sympy.polys.domains.domain.Domain.exquo" title="sympy.polys.domains.domain.Domain.exquo"><code class="xref py py-obj docutils literal notranslate"><span class="pre">exquo</span></code></a></dt><dd><p>Analogue of <code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">/</span> <span class="pre">b</span></code></p>
</dd>
</dl>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.revert">
<span class="sig-name descname"><span class="pre">revert</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L1159-L1161"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.revert" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">a**(-1)</span></code> if possible.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.sqrt">
<span class="sig-name descname"><span class="pre">sqrt</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L1199-L1201"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.sqrt" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns square root of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.sub">
<span class="sig-name descname"><span class="pre">sub</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L944-L946"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.sub" title="Permalink to this definition">¶</a></dt>
<dd><p>Difference of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies <code class="docutils literal notranslate"><span class="pre">__sub__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.to_sympy">
<span class="sig-name descname"><span class="pre">to_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L484-L575"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.to_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert domain element <em>a</em> to a SymPy expression (Expr).</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>a: domain element</strong></p>
<blockquote>
<div><p>An element of this <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a>.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>expr: Expr</p>
<blockquote>
<div><p>A normal sympy expression of type <a class="reference internal" href="../core.html#sympy.core.expr.Expr" title="sympy.core.expr.Expr"><code class="xref py py-class docutils literal notranslate"><span class="pre">Expr</span></code></a>.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>Convert a <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> element <em>a</em> to <a class="reference internal" href="../core.html#sympy.core.expr.Expr" title="sympy.core.expr.Expr"><code class="xref py py-class docutils literal notranslate"><span class="pre">Expr</span></code></a>. Most
public SymPy functions work with objects of type <a class="reference internal" href="../core.html#sympy.core.expr.Expr" title="sympy.core.expr.Expr"><code class="xref py py-class docutils literal notranslate"><span class="pre">Expr</span></code></a>.
The elements of a <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> have a different internal
representation. It is not possible to mix domain elements with
<a class="reference internal" href="../core.html#sympy.core.expr.Expr" title="sympy.core.expr.Expr"><code class="xref py py-class docutils literal notranslate"><span class="pre">Expr</span></code></a> so each domain has <a class="reference internal" href="#sympy.polys.domains.domain.Domain.to_sympy" title="sympy.polys.domains.domain.Domain.to_sympy"><code class="xref py py-meth docutils literal notranslate"><span class="pre">to_sympy()</span></code></a> and
<a class="reference internal" href="#sympy.polys.domains.domain.Domain.from_sympy" title="sympy.polys.domains.domain.Domain.from_sympy"><code class="xref py py-meth docutils literal notranslate"><span class="pre">from_sympy()</span></code></a> methods to convert its domain elements
to and from <a class="reference internal" href="../core.html#sympy.core.expr.Expr" title="sympy.core.expr.Expr"><code class="xref py py-class docutils literal notranslate"><span class="pre">Expr</span></code></a>.</p>
<p class="rubric">Examples</p>
<p>Construct an element of the <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a> domain and then convert it to
<a class="reference internal" href="../core.html#sympy.core.expr.Expr" title="sympy.core.expr.Expr"><code class="xref py py-class docutils literal notranslate"><span class="pre">Expr</span></code></a>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span><span class="p">,</span> <span class="n">Expr</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q_domain</span> <span class="o">=</span> <span class="n">QQ</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q_domain</span>
<span class="go">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q_expr</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">to_sympy</span><span class="p">(</span><span class="n">q_domain</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q_expr</span>
<span class="go">2</span>
</pre></div>
</div>
<p>Although the printed forms look similar these objects are not of the
same type.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="nb">isinstance</span><span class="p">(</span><span class="n">q_domain</span><span class="p">,</span> <span class="n">Expr</span><span class="p">)</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">isinstance</span><span class="p">(</span><span class="n">q_expr</span><span class="p">,</span> <span class="n">Expr</span><span class="p">)</span>
<span class="go">True</span>
</pre></div>
</div>
<p>Construct an element of <a class="reference internal" href="#k-x"><span class="std std-ref">K[x]</span></a> and convert to
<a class="reference internal" href="../core.html#sympy.core.expr.Expr" title="sympy.core.expr.Expr"><code class="xref py py-class docutils literal notranslate"><span class="pre">Expr</span></code></a>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">QQ</span><span class="p">[</span><span class="n">x</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x_domain</span> <span class="o">=</span> <span class="n">K</span><span class="o">.</span><span class="n">gens</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>  <span class="c1"># generator x as a domain element</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p_domain</span> <span class="o">=</span> <span class="n">x_domain</span><span class="o">**</span><span class="mi">2</span><span class="o">/</span><span class="mi">3</span> <span class="o">+</span> <span class="mi">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p_domain</span>
<span class="go">1/3*x**2 + 1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p_expr</span> <span class="o">=</span> <span class="n">K</span><span class="o">.</span><span class="n">to_sympy</span><span class="p">(</span><span class="n">p_domain</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p_expr</span>
<span class="go">x**2/3 + 1</span>
</pre></div>
</div>
<p>The <a class="reference internal" href="#sympy.polys.domains.domain.Domain.from_sympy" title="sympy.polys.domains.domain.Domain.from_sympy"><code class="xref py py-meth docutils literal notranslate"><span class="pre">from_sympy()</span></code></a> method is used for the opposite
conversion from a normal SymPy expression to a domain element.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">p_domain</span> <span class="o">==</span> <span class="n">p_expr</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">from_sympy</span><span class="p">(</span><span class="n">p_expr</span><span class="p">)</span> <span class="o">==</span> <span class="n">p_domain</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">to_sympy</span><span class="p">(</span><span class="n">p_domain</span><span class="p">)</span> <span class="o">==</span> <span class="n">p_expr</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">from_sympy</span><span class="p">(</span><span class="n">K</span><span class="o">.</span><span class="n">to_sympy</span><span class="p">(</span><span class="n">p_domain</span><span class="p">))</span> <span class="o">==</span> <span class="n">p_domain</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">to_sympy</span><span class="p">(</span><span class="n">K</span><span class="o">.</span><span class="n">from_sympy</span><span class="p">(</span><span class="n">p_expr</span><span class="p">))</span> <span class="o">==</span> <span class="n">p_expr</span>
<span class="go">True</span>
</pre></div>
</div>
<p>The <a class="reference internal" href="#sympy.polys.domains.domain.Domain.from_sympy" title="sympy.polys.domains.domain.Domain.from_sympy"><code class="xref py py-meth docutils literal notranslate"><span class="pre">from_sympy()</span></code></a> method makes it easier to construct
domain elements interactively.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">QQ</span><span class="p">[</span><span class="n">x</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">from_sympy</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">/</span><span class="mi">3</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">1/3*x**2 + 1</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.polys.domains.domain.Domain.from_sympy" title="sympy.polys.domains.domain.Domain.from_sympy"><code class="xref py py-obj docutils literal notranslate"><span class="pre">from_sympy</span></code></a>, <a class="reference internal" href="#sympy.polys.domains.domain.Domain.convert_from" title="sympy.polys.domains.domain.Domain.convert_from"><code class="xref py py-obj docutils literal notranslate"><span class="pre">convert_from</span></code></a></p>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.tp">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">tp</span></span><a class="headerlink" href="#sympy.polys.domains.domain.Domain.tp" title="Permalink to this definition">¶</a></dt>
<dd><p>Alias for <a class="reference internal" href="#sympy.polys.domains.domain.Domain.dtype" title="sympy.polys.domains.domain.Domain.dtype"><code class="xref py py-attr docutils literal notranslate"><span class="pre">dtype</span></code></a></p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.unify">
<span class="sig-name descname"><span class="pre">unify</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">K1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">symbols</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domain.py#L683-L823"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domain.Domain.unify" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a minimal domain that contains elements of <code class="docutils literal notranslate"><span class="pre">K0</span></code> and <code class="docutils literal notranslate"><span class="pre">K1</span></code>.</p>
<p>Known domains (from smallest to largest):</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">GF(p)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ZZ</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">QQ</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">RR(prec,</span> <span class="pre">tol)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">CC(prec,</span> <span class="pre">tol)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ALG(a,</span> <span class="pre">b,</span> <span class="pre">c)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">K[x,</span> <span class="pre">y,</span> <span class="pre">z]</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">K(x,</span> <span class="pre">y,</span> <span class="pre">z)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">EX</span></code></p></li>
</ul>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.polys.domains.domain.Domain.zero">
<span class="sig-name descname"><span class="pre">zero</span></span><em class="property"><span class="pre">:</span> <span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Any</span><span class="p"><span class="pre">]</span></span></em><em class="property"> <span class="pre">=</span> <span class="pre">None</span></em><a class="headerlink" href="#sympy.polys.domains.domain.Domain.zero" title="Permalink to this definition">¶</a></dt>
<dd><p>The zero element of the <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">zero</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">of_type</span><span class="p">(</span><span class="n">QQ</span><span class="o">.</span><span class="n">zero</span><span class="p">)</span>
<span class="go">True</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.polys.domains.domain.Domain.of_type" title="sympy.polys.domains.domain.Domain.of_type"><code class="xref py py-obj docutils literal notranslate"><span class="pre">of_type</span></code></a>, <a class="reference internal" href="#sympy.polys.domains.domain.Domain.one" title="sympy.polys.domains.domain.Domain.one"><code class="xref py py-obj docutils literal notranslate"><span class="pre">one</span></code></a></p>
</div>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.domainelement.DomainElement">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.domainelement.</span></span><span class="sig-name descname"><span class="pre">DomainElement</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domainelement.py#L6-L36"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domainelement.DomainElement" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents an element of a domain.</p>
<p>Mix in this trait into a class whose instances should be recognized as
elements of a domain. Method <code class="docutils literal notranslate"><span class="pre">parent()</span></code> gives that domain.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.domainelement.DomainElement.parent">
<span class="sig-name descname"><span class="pre">parent</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/domainelement.py#L15-L36"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.domainelement.DomainElement.parent" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the domain associated with <code class="docutils literal notranslate"><span class="pre">self</span></code></p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ</span><span class="p">,</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;x, y&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">ZZ</span><span class="p">[</span><span class="n">x</span><span class="p">,</span><span class="n">y</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">K</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">K</span><span class="p">(</span><span class="n">y</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span>
<span class="go">x**2 + y**2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">.</span><span class="n">parent</span><span class="p">()</span>
<span class="go">ZZ[x,y]</span>
</pre></div>
</div>
<p class="rubric">Notes</p>
<p>This is used by <a class="reference internal" href="#sympy.polys.domains.domain.Domain.convert" title="sympy.polys.domains.domain.Domain.convert"><code class="xref py py-meth docutils literal notranslate"><span class="pre">convert()</span></code></a> to identify the domain
associated with a domain element.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.field.Field">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.field.</span></span><span class="sig-name descname"><span class="pre">Field</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/field.py#L8-L104"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.field.Field" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents a field domain.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.field.Field.div">
<span class="sig-name descname"><span class="pre">div</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/field.py#L35-L37"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.field.Field.div" title="Permalink to this definition">¶</a></dt>
<dd><p>Division of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies <code class="docutils literal notranslate"><span class="pre">__truediv__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.field.Field.exquo">
<span class="sig-name descname"><span class="pre">exquo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/field.py#L23-L25"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.field.Field.exquo" title="Permalink to this definition">¶</a></dt>
<dd><p>Exact quotient of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies <code class="docutils literal notranslate"><span class="pre">__truediv__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.field.Field.gcd">
<span class="sig-name descname"><span class="pre">gcd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/field.py#L39-L69"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.field.Field.gcd" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns GCD of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>.</p>
<p>This definition of GCD over fields allows to clear denominators
in <span class="math notranslate nohighlight">\(primitive()\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">S</span><span class="p">,</span> <span class="n">gcd</span><span class="p">,</span> <span class="n">primitive</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">gcd</span><span class="p">(</span><span class="n">QQ</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="n">QQ</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">9</span><span class="p">))</span>
<span class="go">2/9</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">gcd</span><span class="p">(</span><span class="n">S</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">/</span><span class="mi">3</span><span class="p">,</span> <span class="n">S</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span><span class="o">/</span><span class="mi">9</span><span class="p">)</span>
<span class="go">2/9</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">primitive</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">x</span><span class="o">/</span><span class="mi">3</span> <span class="o">+</span> <span class="n">S</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span><span class="o">/</span><span class="mi">9</span><span class="p">)</span>
<span class="go">(2/9, 3*x + 2)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.field.Field.get_field">
<span class="sig-name descname"><span class="pre">get_field</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/field.py#L19-L21"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.field.Field.get_field" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a field associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.field.Field.get_ring">
<span class="sig-name descname"><span class="pre">get_ring</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/field.py#L15-L17"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.field.Field.get_ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a ring associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.field.Field.is_unit">
<span class="sig-name descname"><span class="pre">is_unit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/field.py#L102-L104"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.field.Field.is_unit" title="Permalink to this definition">¶</a></dt>
<dd><p>Return true if <code class="docutils literal notranslate"><span class="pre">a</span></code> is a invertible</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.field.Field.lcm">
<span class="sig-name descname"><span class="pre">lcm</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/field.py#L71-L93"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.field.Field.lcm" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns LCM of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">S</span><span class="p">,</span> <span class="n">lcm</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">lcm</span><span class="p">(</span><span class="n">QQ</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="n">QQ</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">9</span><span class="p">))</span>
<span class="go">4/3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">lcm</span><span class="p">(</span><span class="n">S</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">/</span><span class="mi">3</span><span class="p">,</span> <span class="n">S</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span><span class="o">/</span><span class="mi">9</span><span class="p">)</span>
<span class="go">4/3</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.field.Field.quo">
<span class="sig-name descname"><span class="pre">quo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/field.py#L27-L29"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.field.Field.quo" title="Permalink to this definition">¶</a></dt>
<dd><p>Quotient of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies <code class="docutils literal notranslate"><span class="pre">__truediv__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.field.Field.rem">
<span class="sig-name descname"><span class="pre">rem</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/field.py#L31-L33"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.field.Field.rem" title="Permalink to this definition">¶</a></dt>
<dd><p>Remainder of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies nothing.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.field.Field.revert">
<span class="sig-name descname"><span class="pre">revert</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/field.py#L95-L100"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.field.Field.revert" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">a**(-1)</span></code> if possible.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.ring.Ring">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.ring.</span></span><span class="sig-name descname"><span class="pre">Ring</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/ring.py#L9-L118"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ring.Ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents a ring domain.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ring.Ring.denom">
<span class="sig-name descname"><span class="pre">denom</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/ring.py#L65-L67"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ring.Ring.denom" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns denominator of <span class="math notranslate nohighlight">\(a\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ring.Ring.div">
<span class="sig-name descname"><span class="pre">div</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/ring.py#L34-L36"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ring.Ring.div" title="Permalink to this definition">¶</a></dt>
<dd><p>Division of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies <code class="docutils literal notranslate"><span class="pre">__divmod__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ring.Ring.exquo">
<span class="sig-name descname"><span class="pre">exquo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/ring.py#L19-L24"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ring.Ring.exquo" title="Permalink to this definition">¶</a></dt>
<dd><p>Exact quotient of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies <code class="docutils literal notranslate"><span class="pre">__floordiv__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ring.Ring.free_module">
<span class="sig-name descname"><span class="pre">free_module</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rank</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/ring.py#L69-L78"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ring.Ring.free_module" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a free module of rank <code class="docutils literal notranslate"><span class="pre">rank</span></code> over self.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="go">QQ[x]**2</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ring.Ring.get_ring">
<span class="sig-name descname"><span class="pre">get_ring</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/ring.py#L15-L17"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ring.Ring.get_ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a ring associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ring.Ring.ideal">
<span class="sig-name descname"><span class="pre">ideal</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">gens</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/ring.py#L80-L91"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ring.Ring.ideal" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate an ideal of <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>
<span class="go">&lt;x**2&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ring.Ring.invert">
<span class="sig-name descname"><span class="pre">invert</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/ring.py#L38-L45"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ring.Ring.invert" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns inversion of <code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">mod</span> <span class="pre">b</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ring.Ring.numer">
<span class="sig-name descname"><span class="pre">numer</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/ring.py#L61-L63"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ring.Ring.numer" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns numerator of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ring.Ring.quo">
<span class="sig-name descname"><span class="pre">quo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/ring.py#L26-L28"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ring.Ring.quo" title="Permalink to this definition">¶</a></dt>
<dd><p>Quotient of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies <code class="docutils literal notranslate"><span class="pre">__floordiv__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ring.Ring.quotient_ring">
<span class="sig-name descname"><span class="pre">quotient_ring</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">e</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/ring.py#L93-L115"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ring.Ring.quotient_ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Form a quotient ring of <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<p>Here <code class="docutils literal notranslate"><span class="pre">e</span></code> can be an ideal or an iterable.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">quotient_ring</span><span class="p">(</span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">))</span>
<span class="go">QQ[x]/&lt;x**2&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">quotient_ring</span><span class="p">([</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">])</span>
<span class="go">QQ[x]/&lt;x**2&gt;</span>
</pre></div>
</div>
<p>The division operator has been overloaded for this:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">/</span><span class="p">[</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">]</span>
<span class="go">QQ[x]/&lt;x**2&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ring.Ring.rem">
<span class="sig-name descname"><span class="pre">rem</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/ring.py#L30-L32"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ring.Ring.rem" title="Permalink to this definition">¶</a></dt>
<dd><p>Remainder of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies <code class="docutils literal notranslate"><span class="pre">__mod__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ring.Ring.revert">
<span class="sig-name descname"><span class="pre">revert</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/ring.py#L47-L52"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ring.Ring.revert" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">a**(-1)</span></code> if possible.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.simpledomain.SimpleDomain">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.simpledomain.</span></span><span class="sig-name descname"><span class="pre">SimpleDomain</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/simpledomain.py#L7-L15"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.simpledomain.SimpleDomain" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for simple domains, e.g. ZZ, QQ.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.simpledomain.SimpleDomain.inject">
<span class="sig-name descname"><span class="pre">inject</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">gens</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/simpledomain.py#L13-L15"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.simpledomain.SimpleDomain.inject" title="Permalink to this definition">¶</a></dt>
<dd><p>Inject generators into this domain.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.compositedomain.CompositeDomain">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.compositedomain.</span></span><span class="sig-name descname"><span class="pre">CompositeDomain</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/compositedomain.py#L9-L32"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.compositedomain.CompositeDomain" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for composite domains, e.g. ZZ[x], ZZ(X).</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.compositedomain.CompositeDomain.drop">
<span class="sig-name descname"><span class="pre">drop</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">symbols</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/compositedomain.py#L24-L32"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.compositedomain.CompositeDomain.drop" title="Permalink to this definition">¶</a></dt>
<dd><p>Drop generators from this domain.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.compositedomain.CompositeDomain.inject">
<span class="sig-name descname"><span class="pre">inject</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">symbols</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/compositedomain.py#L17-L22"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.compositedomain.CompositeDomain.inject" title="Permalink to this definition">¶</a></dt>
<dd><p>Inject generators into this domain.</p>
</dd></dl>

</dd></dl>

</section>
<section id="gf-p">
<span id="id1"></span><h2>GF(p)<a class="headerlink" href="#gf-p" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.FiniteField">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.</span></span><span class="sig-name descname"><span class="pre">FiniteField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mod</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">symmetric</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/finitefield.py#L12-L203"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FiniteField" title="Permalink to this definition">¶</a></dt>
<dd><p>Finite field of prime order <a class="reference internal" href="#gf-p"><span class="std std-ref">GF(p)</span></a></p>
<p>A <a class="reference internal" href="#gf-p"><span class="std std-ref">GF(p)</span></a> domain represents a <a class="reference external" href="https://en.wikipedia.org/wiki/Finite_field">finite field</a> <span class="math notranslate nohighlight">\(\mathbb{F}_p\)</span> of prime
order as <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> in the domain system (see
<a class="reference internal" href="domainsintro.html#polys-domainsintro"><span class="std std-ref">Introducing the Domains of the poly module</span></a>).</p>
<p>A <a class="reference internal" href="reference.html#sympy.polys.polytools.Poly" title="sympy.polys.polytools.Poly"><code class="xref py py-class docutils literal notranslate"><span class="pre">Poly</span></code></a> created from an expression with integer
coefficients will have the domain <a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a>. Howeer if the <code class="docutils literal notranslate"><span class="pre">modulus=p</span></code>
option is given the the domain will be a finite field instead.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Poly</span><span class="p">,</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span>
<span class="go">Poly(x**2 + 1, x, domain=&#39;ZZ&#39;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">.</span><span class="n">domain</span>
<span class="go">ZZ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p2</span> <span class="o">=</span> <span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">modulus</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p2</span>
<span class="go">Poly(x**2 + 1, x, modulus=2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p2</span><span class="o">.</span><span class="n">domain</span>
<span class="go">GF(2)</span>
</pre></div>
</div>
<p>It is possible to factorise a polynomial over <a class="reference internal" href="#gf-p"><span class="std std-ref">GF(p)</span></a> using the
modulus argument to <a class="reference internal" href="reference.html#sympy.polys.polytools.factor" title="sympy.polys.polytools.factor"><code class="xref py py-func docutils literal notranslate"><span class="pre">factor()</span></code></a> or by specifying the domain
explicitly. The domain can also be given as a string.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">factor</span><span class="p">,</span> <span class="n">GF</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">x**2 + 1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">modulus</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
<span class="go">(x + 1)**2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">domain</span><span class="o">=</span><span class="n">GF</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">(x + 1)**2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">domain</span><span class="o">=</span><span class="s1">&#39;GF(2)&#39;</span><span class="p">)</span>
<span class="go">(x + 1)**2</span>
</pre></div>
</div>
<p>It is also possible to use <a class="reference internal" href="#gf-p"><span class="std std-ref">GF(p)</span></a> with the <a class="reference internal" href="reference.html#sympy.polys.polytools.cancel" title="sympy.polys.polytools.cancel"><code class="xref py py-func docutils literal notranslate"><span class="pre">cancel()</span></code></a>
and <a class="reference internal" href="reference.html#sympy.polys.polytools.gcd" title="sympy.polys.polytools.gcd"><code class="xref py py-func docutils literal notranslate"><span class="pre">gcd()</span></code></a> functions.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">cancel</span><span class="p">,</span> <span class="n">gcd</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cancel</span><span class="p">((</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="n">x</span> <span class="o">+</span> <span class="mi">1</span><span class="p">))</span>
<span class="go">(x**2 + 1)/(x + 1)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cancel</span><span class="p">((</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="n">x</span> <span class="o">+</span> <span class="mi">1</span><span class="p">),</span> <span class="n">domain</span><span class="o">=</span><span class="n">GF</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">x + 1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">gcd</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">x</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">gcd</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">x</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">domain</span><span class="o">=</span><span class="n">GF</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">x + 1</span>
</pre></div>
</div>
<p>When using the domain directly <a class="reference internal" href="#gf-p"><span class="std std-ref">GF(p)</span></a> can be used as a constructor
to create instances which then support the operations <code class="docutils literal notranslate"><span class="pre">+,-,*,**,/</span></code></p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">GF</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">GF</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span>
<span class="go">GF(5)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">K</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">K</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">3 mod 5</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span>
<span class="go">2 mod 5</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">*</span> <span class="n">y</span>
<span class="go">1 mod 5</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">/</span> <span class="n">y</span>
<span class="go">4 mod 5</span>
</pre></div>
</div>
<p class="rubric">Notes</p>
<p>It is also possible to create a <a class="reference internal" href="#gf-p"><span class="std std-ref">GF(p)</span></a> domain of <strong>non-prime</strong>
order but the resulting ring is <strong>not</strong> a field: it is just the ring of
the integers modulo <code class="docutils literal notranslate"><span class="pre">n</span></code>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">GF</span><span class="p">(</span><span class="mi">9</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z</span> <span class="o">=</span> <span class="n">K</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z</span>
<span class="go">3 mod 9</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z</span><span class="o">**</span><span class="mi">2</span>
<span class="go">0 mod 9</span>
</pre></div>
</div>
<p>It would be good to have a proper implementation of prime power fields
(<code class="docutils literal notranslate"><span class="pre">GF(p**n)</span></code>) but these are not yet implemented in SymPY.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FiniteField.characteristic">
<span class="sig-name descname"><span class="pre">characteristic</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/finitefield.py#L138-L140"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FiniteField.characteristic" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the characteristic of this domain.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FiniteField.from_FF">
<span class="sig-name descname"><span class="pre">from_FF</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/finitefield.py#L159-L161"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FiniteField.from_FF" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">ModularInteger(int)</span></code> to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FiniteField.from_FF_gmpy">
<span class="sig-name descname"><span class="pre">from_FF_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/finitefield.py#L185-L187"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FiniteField.from_FF_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">ModularInteger(mpz)</span></code> to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FiniteField.from_FF_python">
<span class="sig-name descname"><span class="pre">from_FF_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/finitefield.py#L163-L165"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FiniteField.from_FF_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">ModularInteger(int)</span></code> to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FiniteField.from_QQ">
<span class="sig-name descname"><span class="pre">from_QQ</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/finitefield.py#L175-L178"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FiniteField.from_QQ" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert Python’s <code class="docutils literal notranslate"><span class="pre">Fraction</span></code> to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FiniteField.from_QQ_gmpy">
<span class="sig-name descname"><span class="pre">from_QQ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/finitefield.py#L193-L196"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FiniteField.from_QQ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert GMPY’s <code class="docutils literal notranslate"><span class="pre">mpq</span></code> to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FiniteField.from_QQ_python">
<span class="sig-name descname"><span class="pre">from_QQ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/finitefield.py#L180-L183"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FiniteField.from_QQ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert Python’s <code class="docutils literal notranslate"><span class="pre">Fraction</span></code> to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FiniteField.from_RealField">
<span class="sig-name descname"><span class="pre">from_RealField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/finitefield.py#L198-L203"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FiniteField.from_RealField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert mpmath’s <code class="docutils literal notranslate"><span class="pre">mpf</span></code> to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FiniteField.from_ZZ">
<span class="sig-name descname"><span class="pre">from_ZZ</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/finitefield.py#L167-L169"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FiniteField.from_ZZ" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert Python’s <code class="docutils literal notranslate"><span class="pre">int</span></code> to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FiniteField.from_ZZ_gmpy">
<span class="sig-name descname"><span class="pre">from_ZZ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/finitefield.py#L189-L191"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FiniteField.from_ZZ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code> to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FiniteField.from_ZZ_python">
<span class="sig-name descname"><span class="pre">from_ZZ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/finitefield.py#L171-L173"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FiniteField.from_ZZ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert Python’s <code class="docutils literal notranslate"><span class="pre">int</span></code> to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FiniteField.from_sympy">
<span class="sig-name descname"><span class="pre">from_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/finitefield.py#L150-L157"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FiniteField.from_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert SymPy’s Integer to SymPy’s <code class="docutils literal notranslate"><span class="pre">Integer</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FiniteField.get_field">
<span class="sig-name descname"><span class="pre">get_field</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/finitefield.py#L142-L144"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FiniteField.get_field" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a field associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FiniteField.to_sympy">
<span class="sig-name descname"><span class="pre">to_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/finitefield.py#L146-L148"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FiniteField.to_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">a</span></code> to a SymPy object.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.PythonFiniteField">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.</span></span><span class="sig-name descname"><span class="pre">PythonFiniteField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mod</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">symmetric</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/pythonfinitefield.py#L9-L16"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PythonFiniteField" title="Permalink to this definition">¶</a></dt>
<dd><p>Finite field based on Python’s integers.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYFiniteField">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.</span></span><span class="sig-name descname"><span class="pre">GMPYFiniteField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mod</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">symmetric</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyfinitefield.py#L9-L16"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYFiniteField" title="Permalink to this definition">¶</a></dt>
<dd><p>Finite field based on GMPY integers.</p>
</dd></dl>

</section>
<section id="zz">
<span id="id2"></span><h2>ZZ<a class="headerlink" href="#zz" title="Permalink to this headline">¶</a></h2>
<p>The <a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a> domain represents the <a class="reference external" href="https://en.wikipedia.org/wiki/Integer">integers</a> <span class="math notranslate nohighlight">\(\mathbb{Z}\)</span> as a
<a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> in the domain system (see <a class="reference internal" href="domainsintro.html#polys-domainsintro"><span class="std std-ref">Introducing the Domains of the poly module</span></a>).</p>
<p>By default a <a class="reference internal" href="reference.html#sympy.polys.polytools.Poly" title="sympy.polys.polytools.Poly"><code class="xref py py-class docutils literal notranslate"><span class="pre">Poly</span></code></a> created from an expression with integer
coefficients will have the domain <a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Poly</span><span class="p">,</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span>
<span class="go">Poly(x**2 + 1, x, domain=&#39;ZZ&#39;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">.</span><span class="n">domain</span>
<span class="go">ZZ</span>
</pre></div>
</div>
<p>The corresponding <a class="reference external" href="https://en.wikipedia.org/wiki/Field_of_fractions">field of fractions</a> is the domain of the rationals
<a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a>. Conversely <a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a> is the <a class="reference external" href="https://en.wikipedia.org/wiki/Ring_of_integers">ring of integers</a> of <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ</span><span class="p">,</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">get_field</span><span class="p">()</span>
<span class="go">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">get_ring</span><span class="p">()</span>
<span class="go">ZZ</span>
</pre></div>
</div>
<p>When using the domain directly <a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a> can be used as a constructor to
create instances which then support the operations <code class="docutils literal notranslate"><span class="pre">+,-,*,**,//,%</span></code> (true
division <code class="docutils literal notranslate"><span class="pre">/</span></code> should not be used with <a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a> - see the
<a class="reference internal" href="#sympy.polys.domains.domain.Domain.exquo" title="sympy.polys.domains.domain.Domain.exquo"><code class="xref py py-meth docutils literal notranslate"><span class="pre">exquo()</span></code></a> domain method):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">ZZ</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">//</span> <span class="n">y</span>  <span class="c1"># floor division</span>
<span class="go">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">%</span> <span class="n">y</span>   <span class="c1"># modulo division (remainder)</span>
<span class="go">1</span>
</pre></div>
</div>
<p>The <a class="reference internal" href="#sympy.polys.domains.domain.Domain.gcd" title="sympy.polys.domains.domain.Domain.gcd"><code class="xref py py-meth docutils literal notranslate"><span class="pre">gcd()</span></code></a> method can be used to compute the <a class="reference external" href="https://en.wikipedia.org/wiki/Greatest_common_divisor">gcd</a> of any
two elements:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">gcd</span><span class="p">(</span><span class="n">ZZ</span><span class="p">(</span><span class="mi">10</span><span class="p">),</span> <span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">2</span>
</pre></div>
</div>
<p>There are two implementations of <a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a> in SymPy. If <code class="docutils literal notranslate"><span class="pre">gmpy</span></code> or <code class="docutils literal notranslate"><span class="pre">gmpy2</span></code>
is installed then <a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a> will be implemented by <a class="reference internal" href="#sympy.polys.domains.GMPYIntegerRing" title="sympy.polys.domains.GMPYIntegerRing"><code class="xref py py-class docutils literal notranslate"><span class="pre">GMPYIntegerRing</span></code></a>
and the elements will be instances of the <code class="docutils literal notranslate"><span class="pre">gmpy.mpz</span></code> type. Otherwise if
<code class="docutils literal notranslate"><span class="pre">gmpy</span></code> and <code class="docutils literal notranslate"><span class="pre">gmpy2</span></code> are not installed then <a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a> will be implemented by
<a class="reference internal" href="#sympy.polys.domains.PythonIntegerRing" title="sympy.polys.domains.PythonIntegerRing"><code class="xref py py-class docutils literal notranslate"><span class="pre">PythonIntegerRing</span></code></a> which uses Python’s standard builtin <code class="docutils literal notranslate"><span class="pre">int</span></code>
type. With larger integers <code class="docutils literal notranslate"><span class="pre">gmpy</span></code> can be more efficient so it is preferred
when available.</p>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.</span></span><span class="sig-name descname"><span class="pre">IntegerRing</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L19-L224"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing" title="Permalink to this definition">¶</a></dt>
<dd><p>The domain <code class="docutils literal notranslate"><span class="pre">ZZ</span></code> representing the integers <span class="math notranslate nohighlight">\(\mathbb{Z}\)</span>.</p>
<p>The <a class="reference internal" href="#sympy.polys.domains.IntegerRing" title="sympy.polys.domains.IntegerRing"><code class="xref py py-class docutils literal notranslate"><span class="pre">IntegerRing</span></code></a> class represents the ring of integers as a
<a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> in the domain system. <a class="reference internal" href="#sympy.polys.domains.IntegerRing" title="sympy.polys.domains.IntegerRing"><code class="xref py py-class docutils literal notranslate"><span class="pre">IntegerRing</span></code></a> is a
super class of <a class="reference internal" href="#sympy.polys.domains.PythonIntegerRing" title="sympy.polys.domains.PythonIntegerRing"><code class="xref py py-class docutils literal notranslate"><span class="pre">PythonIntegerRing</span></code></a> and
<a class="reference internal" href="#sympy.polys.domains.GMPYIntegerRing" title="sympy.polys.domains.GMPYIntegerRing"><code class="xref py py-class docutils literal notranslate"><span class="pre">GMPYIntegerRing</span></code></a> one of which will be the implementation for
<a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a> depending on whether or not <code class="docutils literal notranslate"><span class="pre">gmpy</span></code> or <code class="docutils literal notranslate"><span class="pre">gmpy2</span></code> is installed.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Domain</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.algebraic_field">
<span class="sig-name descname"><span class="pre">algebraic_field</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">extension</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L87-L110"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.algebraic_field" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an algebraic field, i.e. <span class="math notranslate nohighlight">\(\mathbb{Q}(\alpha, \ldots)\)</span>.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>*extension: One or more Expr.</strong></p>
<blockquote>
<div><p>Generators of the extension. These should be expressions that are
algebraic over <span class="math notranslate nohighlight">\(\mathbb{Q}\)</span>.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><a class="reference internal" href="#sympy.polys.domains.AlgebraicField" title="sympy.polys.domains.AlgebraicField"><code class="xref py py-class docutils literal notranslate"><span class="pre">AlgebraicField</span></code></a></p>
<blockquote>
<div><p>A <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> representing the algebraic field extension.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ</span><span class="p">,</span> <span class="n">sqrt</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">algebraic_field</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">QQ&lt;sqrt(2)&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.factorial">
<span class="sig-name descname"><span class="pre">factorial</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L222-L224"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.factorial" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute factorial of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.from_AlgebraicField">
<span class="sig-name descname"><span class="pre">from_AlgebraicField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L112-L118"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.from_AlgebraicField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a <a class="reference internal" href="#sympy.polys.polyclasses.ANP" title="sympy.polys.polyclasses.ANP"><code class="xref py py-class docutils literal notranslate"><span class="pre">ANP</span></code></a> object to <a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a>.</p>
<p>See <a class="reference internal" href="#sympy.polys.domains.domain.Domain.convert" title="sympy.polys.domains.domain.Domain.convert"><code class="xref py py-meth docutils literal notranslate"><span class="pre">convert()</span></code></a>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.from_FF">
<span class="sig-name descname"><span class="pre">from_FF</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L152-L154"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.from_FF" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">ModularInteger(int)</span></code> to GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.from_FF_gmpy">
<span class="sig-name descname"><span class="pre">from_FF_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L178-L180"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.from_FF_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">ModularInteger(mpz)</span></code> to GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.from_FF_python">
<span class="sig-name descname"><span class="pre">from_FF_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L156-L158"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.from_FF_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">ModularInteger(int)</span></code> to GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.from_QQ">
<span class="sig-name descname"><span class="pre">from_QQ</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L168-L171"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.from_QQ" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert Python’s <code class="docutils literal notranslate"><span class="pre">Fraction</span></code> to GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.from_QQ_gmpy">
<span class="sig-name descname"><span class="pre">from_QQ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L186-L189"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.from_QQ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert GMPY <code class="docutils literal notranslate"><span class="pre">mpq</span></code> to GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.from_QQ_python">
<span class="sig-name descname"><span class="pre">from_QQ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L173-L176"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.from_QQ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert Python’s <code class="docutils literal notranslate"><span class="pre">Fraction</span></code> to GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.from_RealField">
<span class="sig-name descname"><span class="pre">from_RealField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L191-L196"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.from_RealField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert mpmath’s <code class="docutils literal notranslate"><span class="pre">mpf</span></code> to GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.from_ZZ">
<span class="sig-name descname"><span class="pre">from_ZZ</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L160-L162"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.from_ZZ" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert Python’s <code class="docutils literal notranslate"><span class="pre">int</span></code> to GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.from_ZZ_gmpy">
<span class="sig-name descname"><span class="pre">from_ZZ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L182-L184"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.from_ZZ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code> to GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.from_ZZ_python">
<span class="sig-name descname"><span class="pre">from_ZZ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L164-L166"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.from_ZZ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert Python’s <code class="docutils literal notranslate"><span class="pre">int</span></code> to GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.from_sympy">
<span class="sig-name descname"><span class="pre">from_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L57-L64"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.from_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert SymPy’s Integer to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.gcd">
<span class="sig-name descname"><span class="pre">gcd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L210-L212"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.gcd" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute GCD of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.gcdex">
<span class="sig-name descname"><span class="pre">gcdex</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L202-L208"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.gcdex" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute extended GCD of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.get_field">
<span class="sig-name descname"><span class="pre">get_field</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L66-L85"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.get_field" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the associated field of fractions <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a></p>
<dl class="field-list">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a>:</p>
<blockquote>
<div><p>The associated field of fractions <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a>, a
<a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> representing the rational numbers
<span class="math notranslate nohighlight">\(\mathbb{Q}\)</span>.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">get_field</span><span class="p">()</span>
<span class="go">QQ</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.lcm">
<span class="sig-name descname"><span class="pre">lcm</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L214-L216"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.lcm" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute LCM of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.log">
<span class="sig-name descname"><span class="pre">log</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L120-L150"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.log" title="Permalink to this definition">¶</a></dt>
<dd><p>logarithm of <em>a</em> to the base <em>b</em></p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>a: number</strong></p>
<p><strong>b: number</strong></p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><span class="math notranslate nohighlight">\(\\lfloor\log(a, b)\\rfloor\)</span>:</p>
<blockquote>
<div><p>Floor of the logarithm of <em>a</em> to the base <em>b</em></p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">ZZ</span><span class="p">(</span><span class="mi">8</span><span class="p">),</span> <span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">ZZ</span><span class="p">(</span><span class="mi">9</span><span class="p">),</span> <span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">3</span>
</pre></div>
</div>
<p class="rubric">Notes</p>
<p>This function uses <code class="docutils literal notranslate"><span class="pre">math.log</span></code> which is based on <code class="docutils literal notranslate"><span class="pre">float</span></code> so it will
fail for large integer arguments.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.sqrt">
<span class="sig-name descname"><span class="pre">sqrt</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L218-L220"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.sqrt" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute square root of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.IntegerRing.to_sympy">
<span class="sig-name descname"><span class="pre">to_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/integerring.py#L53-L55"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.IntegerRing.to_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">a</span></code> to a SymPy object.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.PythonIntegerRing">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.</span></span><span class="sig-name descname"><span class="pre">PythonIntegerRing</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/pythonintegerring.py#L12-L97"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PythonIntegerRing" title="Permalink to this definition">¶</a></dt>
<dd><p>Integer ring based on Python’s <code class="docutils literal notranslate"><span class="pre">int</span></code> type.</p>
<p>This will be used as <a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a> if <code class="docutils literal notranslate"><span class="pre">gmpy</span></code> and <code class="docutils literal notranslate"><span class="pre">gmpy2</span></code> are not
installed. Elements are instances of the standard Python <code class="docutils literal notranslate"><span class="pre">int</span></code> type.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYIntegerRing">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.</span></span><span class="sig-name descname"><span class="pre">GMPYIntegerRing</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyintegerring.py#L13-L104"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYIntegerRing" title="Permalink to this definition">¶</a></dt>
<dd><p>Integer ring based on GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code> type.</p>
<p>This will be the implementation of <a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a> if <code class="docutils literal notranslate"><span class="pre">gmpy</span></code> or <code class="docutils literal notranslate"><span class="pre">gmpy2</span></code> is
installed. Elements will be of type <code class="docutils literal notranslate"><span class="pre">gmpy.mpz</span></code>.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYIntegerRing.factorial">
<span class="sig-name descname"><span class="pre">factorial</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyintegerring.py#L102-L104"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYIntegerRing.factorial" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute factorial of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYIntegerRing.from_FF_gmpy">
<span class="sig-name descname"><span class="pre">from_FF_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyintegerring.py#L61-L63"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYIntegerRing.from_FF_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">ModularInteger(mpz)</span></code> to GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYIntegerRing.from_FF_python">
<span class="sig-name descname"><span class="pre">from_FF_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyintegerring.py#L43-L45"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYIntegerRing.from_FF_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">ModularInteger(int)</span></code> to GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYIntegerRing.from_QQ">
<span class="sig-name descname"><span class="pre">from_QQ</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyintegerring.py#L51-L54"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYIntegerRing.from_QQ" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert Python’s <code class="docutils literal notranslate"><span class="pre">Fraction</span></code> to GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYIntegerRing.from_QQ_gmpy">
<span class="sig-name descname"><span class="pre">from_QQ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyintegerring.py#L69-L72"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYIntegerRing.from_QQ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert GMPY <code class="docutils literal notranslate"><span class="pre">mpq</span></code> to GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYIntegerRing.from_QQ_python">
<span class="sig-name descname"><span class="pre">from_QQ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyintegerring.py#L56-L59"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYIntegerRing.from_QQ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert Python’s <code class="docutils literal notranslate"><span class="pre">Fraction</span></code> to GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYIntegerRing.from_RealField">
<span class="sig-name descname"><span class="pre">from_RealField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyintegerring.py#L74-L79"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYIntegerRing.from_RealField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert mpmath’s <code class="docutils literal notranslate"><span class="pre">mpf</span></code> to GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYIntegerRing.from_ZZ_gmpy">
<span class="sig-name descname"><span class="pre">from_ZZ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyintegerring.py#L65-L67"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYIntegerRing.from_ZZ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code> to GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYIntegerRing.from_ZZ_python">
<span class="sig-name descname"><span class="pre">from_ZZ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyintegerring.py#L47-L49"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYIntegerRing.from_ZZ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert Python’s <code class="docutils literal notranslate"><span class="pre">int</span></code> to GMPY’s <code class="docutils literal notranslate"><span class="pre">mpz</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYIntegerRing.from_sympy">
<span class="sig-name descname"><span class="pre">from_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyintegerring.py#L34-L41"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYIntegerRing.from_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert SymPy’s Integer to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYIntegerRing.gcd">
<span class="sig-name descname"><span class="pre">gcd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyintegerring.py#L90-L92"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYIntegerRing.gcd" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute GCD of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYIntegerRing.gcdex">
<span class="sig-name descname"><span class="pre">gcdex</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyintegerring.py#L85-L88"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYIntegerRing.gcdex" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute extended GCD of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYIntegerRing.lcm">
<span class="sig-name descname"><span class="pre">lcm</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyintegerring.py#L94-L96"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYIntegerRing.lcm" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute LCM of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYIntegerRing.sqrt">
<span class="sig-name descname"><span class="pre">sqrt</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyintegerring.py#L98-L100"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYIntegerRing.sqrt" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute square root of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYIntegerRing.to_sympy">
<span class="sig-name descname"><span class="pre">to_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyintegerring.py#L30-L32"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYIntegerRing.to_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">a</span></code> to a SymPy object.</p>
</dd></dl>

</dd></dl>

</section>
<section id="qq">
<span id="id3"></span><h2>QQ<a class="headerlink" href="#qq" title="Permalink to this headline">¶</a></h2>
<p>The <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a> domain represents the <a class="reference external" href="https://en.wikipedia.org/wiki/Rational_number">rationals</a> <span class="math notranslate nohighlight">\(\mathbb{Q}\)</span> as a
<a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> in the domain system (see <a class="reference internal" href="domainsintro.html#polys-domainsintro"><span class="std std-ref">Introducing the Domains of the poly module</span></a>).</p>
<p>By default a <a class="reference internal" href="reference.html#sympy.polys.polytools.Poly" title="sympy.polys.polytools.Poly"><code class="xref py py-class docutils literal notranslate"><span class="pre">Poly</span></code></a> created from an expression with rational
coefficients will have the domain <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Poly</span><span class="p">,</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">x</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span>
<span class="go">Poly(x**2 + 1/2*x, x, domain=&#39;QQ&#39;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">.</span><span class="n">domain</span>
<span class="go">QQ</span>
</pre></div>
</div>
<p>The corresponding <a class="reference external" href="https://en.wikipedia.org/wiki/Ring_of_integers">ring of integers</a> is the <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> of the
integers <a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a>. Conversely <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a> is the <a class="reference external" href="https://en.wikipedia.org/wiki/Field_of_fractions">field of fractions</a> of
<a class="reference internal" href="#zz"><span class="std std-ref">ZZ</span></a>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ</span><span class="p">,</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">get_ring</span><span class="p">()</span>
<span class="go">ZZ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ</span><span class="o">.</span><span class="n">get_field</span><span class="p">()</span>
<span class="go">QQ</span>
</pre></div>
</div>
<p>When using the domain directly <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a> can be used as a constructor to
create instances which then support the operations <code class="docutils literal notranslate"><span class="pre">+,-,*,**,/</span></code> (true
division <code class="docutils literal notranslate"><span class="pre">/</span></code> is always possible for nonzero divisors in <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a>):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">QQ</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">QQ</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">/</span> <span class="n">y</span>  <span class="c1"># true division</span>
<span class="go">5/2</span>
</pre></div>
</div>
<p>There are two implementations of <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a> in SymPy. If <code class="docutils literal notranslate"><span class="pre">gmpy</span></code> or <code class="docutils literal notranslate"><span class="pre">gmpy2</span></code>
is installed then <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a> will be implemented by
<a class="reference internal" href="#sympy.polys.domains.GMPYRationalField" title="sympy.polys.domains.GMPYRationalField"><code class="xref py py-class docutils literal notranslate"><span class="pre">GMPYRationalField</span></code></a> and the elements will be instances of the
<code class="docutils literal notranslate"><span class="pre">gmpy.mpq</span></code> type. Otherwise if <code class="docutils literal notranslate"><span class="pre">gmpy</span></code> and <code class="docutils literal notranslate"><span class="pre">gmpy2</span></code> are not installed then
<a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a> will be implemented by <a class="reference internal" href="#sympy.polys.domains.PythonRationalField" title="sympy.polys.domains.PythonRationalField"><code class="xref py py-class docutils literal notranslate"><span class="pre">PythonRationalField</span></code></a> which is a
pure Python class as part of sympy. The <code class="docutils literal notranslate"><span class="pre">gmpy</span></code> implementation is
preferred because it is significantly faster.</p>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.</span></span><span class="sig-name descname"><span class="pre">RationalField</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L14-L156"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField" title="Permalink to this definition">¶</a></dt>
<dd><p>Abstract base class for the domain <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a>.</p>
<p>The <a class="reference internal" href="#sympy.polys.domains.RationalField" title="sympy.polys.domains.RationalField"><code class="xref py py-class docutils literal notranslate"><span class="pre">RationalField</span></code></a> class represents the field of rational
numbers <span class="math notranslate nohighlight">\(\mathbb{Q}\)</span> as a <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> in the domain system.
<a class="reference internal" href="#sympy.polys.domains.RationalField" title="sympy.polys.domains.RationalField"><code class="xref py py-class docutils literal notranslate"><span class="pre">RationalField</span></code></a> is a superclass of
<a class="reference internal" href="#sympy.polys.domains.PythonRationalField" title="sympy.polys.domains.PythonRationalField"><code class="xref py py-class docutils literal notranslate"><span class="pre">PythonRationalField</span></code></a> and <a class="reference internal" href="#sympy.polys.domains.GMPYRationalField" title="sympy.polys.domains.GMPYRationalField"><code class="xref py py-class docutils literal notranslate"><span class="pre">GMPYRationalField</span></code></a> one of
which will be the implementation for <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a> depending on whether either
of <code class="docutils literal notranslate"><span class="pre">gmpy</span></code> or <code class="docutils literal notranslate"><span class="pre">gmpy2</span></code> is installed or not.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Domain</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField.algebraic_field">
<span class="sig-name descname"><span class="pre">algebraic_field</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">extension</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L67-L91"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField.algebraic_field" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an algebraic field, i.e. <span class="math notranslate nohighlight">\(\mathbb{Q}(\alpha, \ldots)\)</span>.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>*extension: One or more Expr</strong></p>
<blockquote>
<div><p>Generators of the extension. These should be expressions that are
algebraic over <span class="math notranslate nohighlight">\(\mathbb{Q}\)</span>.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><a class="reference internal" href="#sympy.polys.domains.AlgebraicField" title="sympy.polys.domains.AlgebraicField"><code class="xref py py-class docutils literal notranslate"><span class="pre">AlgebraicField</span></code></a></p>
<blockquote>
<div><p>A <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> representing the algebraic field extension.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span><span class="p">,</span> <span class="n">sqrt</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">algebraic_field</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">QQ&lt;sqrt(2)&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField.denom">
<span class="sig-name descname"><span class="pre">denom</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L154-L156"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField.denom" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns denominator of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField.div">
<span class="sig-name descname"><span class="pre">div</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L146-L148"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField.div" title="Permalink to this definition">¶</a></dt>
<dd><p>Division of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies <code class="docutils literal notranslate"><span class="pre">__truediv__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField.exquo">
<span class="sig-name descname"><span class="pre">exquo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L134-L136"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField.exquo" title="Permalink to this definition">¶</a></dt>
<dd><p>Exact quotient of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies <code class="docutils literal notranslate"><span class="pre">__truediv__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField.from_AlgebraicField">
<span class="sig-name descname"><span class="pre">from_AlgebraicField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L93-L99"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField.from_AlgebraicField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a <a class="reference internal" href="#sympy.polys.polyclasses.ANP" title="sympy.polys.polyclasses.ANP"><code class="xref py py-class docutils literal notranslate"><span class="pre">ANP</span></code></a> object to <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a>.</p>
<p>See <a class="reference internal" href="#sympy.polys.domains.domain.Domain.convert" title="sympy.polys.domains.domain.Domain.convert"><code class="xref py py-meth docutils literal notranslate"><span class="pre">convert()</span></code></a></p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField.from_GaussianRationalField">
<span class="sig-name descname"><span class="pre">from_GaussianRationalField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L125-L128"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField.from_GaussianRationalField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a <code class="docutils literal notranslate"><span class="pre">GaussianElement</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField.from_QQ">
<span class="sig-name descname"><span class="pre">from_QQ</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L109-L111"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField.from_QQ" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">Fraction</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField.from_QQ_gmpy">
<span class="sig-name descname"><span class="pre">from_QQ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L121-L123"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField.from_QQ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a GMPY <code class="docutils literal notranslate"><span class="pre">mpq</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField.from_QQ_python">
<span class="sig-name descname"><span class="pre">from_QQ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L113-L115"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField.from_QQ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">Fraction</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField.from_RealField">
<span class="sig-name descname"><span class="pre">from_RealField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L130-L132"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField.from_RealField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a mpmath <code class="docutils literal notranslate"><span class="pre">mpf</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField.from_ZZ">
<span class="sig-name descname"><span class="pre">from_ZZ</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L101-L103"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField.from_ZZ" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">int</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField.from_ZZ_gmpy">
<span class="sig-name descname"><span class="pre">from_ZZ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L117-L119"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField.from_ZZ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a GMPY <code class="docutils literal notranslate"><span class="pre">mpz</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField.from_ZZ_python">
<span class="sig-name descname"><span class="pre">from_ZZ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L105-L107"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField.from_ZZ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">int</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField.from_sympy">
<span class="sig-name descname"><span class="pre">from_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L57-L65"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField.from_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert SymPy’s Integer to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField.get_ring">
<span class="sig-name descname"><span class="pre">get_ring</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L48-L51"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField.get_ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns ring associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField.numer">
<span class="sig-name descname"><span class="pre">numer</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L150-L152"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField.numer" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns numerator of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField.quo">
<span class="sig-name descname"><span class="pre">quo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L138-L140"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField.quo" title="Permalink to this definition">¶</a></dt>
<dd><p>Quotient of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies <code class="docutils literal notranslate"><span class="pre">__truediv__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField.rem">
<span class="sig-name descname"><span class="pre">rem</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L142-L144"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField.rem" title="Permalink to this definition">¶</a></dt>
<dd><p>Remainder of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies nothing.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RationalField.to_sympy">
<span class="sig-name descname"><span class="pre">to_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/rationalfield.py#L53-L55"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RationalField.to_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">a</span></code> to a SymPy object.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.PythonRationalField">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.</span></span><span class="sig-name descname"><span class="pre">PythonRationalField</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/pythonrationalfield.py#L9-L73"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PythonRationalField" title="Permalink to this definition">¶</a></dt>
<dd><p>Rational field based on <a class="reference internal" href="#mpq"><span class="std std-ref">MPQ</span></a>.</p>
<p>This will be used as <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a> if <code class="docutils literal notranslate"><span class="pre">gmpy</span></code> and <code class="docutils literal notranslate"><span class="pre">gmpy2</span></code> are not
installed. Elements are instances of <a class="reference internal" href="#mpq"><span class="std std-ref">MPQ</span></a>.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYRationalField">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.</span></span><span class="sig-name descname"><span class="pre">GMPYRationalField</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyrationalfield.py#L12-L100"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYRationalField" title="Permalink to this definition">¶</a></dt>
<dd><p>Rational field based on GMPY’s <code class="docutils literal notranslate"><span class="pre">mpq</span></code> type.</p>
<p>This will be the implementation of <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a> if <code class="docutils literal notranslate"><span class="pre">gmpy</span></code> or <code class="docutils literal notranslate"><span class="pre">gmpy2</span></code> is
installed. Elements will be of type <code class="docutils literal notranslate"><span class="pre">gmpy.mpq</span></code>.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYRationalField.denom">
<span class="sig-name descname"><span class="pre">denom</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyrationalfield.py#L94-L96"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYRationalField.denom" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns denominator of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYRationalField.div">
<span class="sig-name descname"><span class="pre">div</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyrationalfield.py#L86-L88"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYRationalField.div" title="Permalink to this definition">¶</a></dt>
<dd><p>Division of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies <code class="docutils literal notranslate"><span class="pre">__truediv__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYRationalField.exquo">
<span class="sig-name descname"><span class="pre">exquo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyrationalfield.py#L74-L76"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYRationalField.exquo" title="Permalink to this definition">¶</a></dt>
<dd><p>Exact quotient of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies <code class="docutils literal notranslate"><span class="pre">__truediv__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYRationalField.factorial">
<span class="sig-name descname"><span class="pre">factorial</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyrationalfield.py#L98-L100"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYRationalField.factorial" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns factorial of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYRationalField.from_GaussianRationalField">
<span class="sig-name descname"><span class="pre">from_GaussianRationalField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyrationalfield.py#L65-L68"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYRationalField.from_GaussianRationalField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a <code class="docutils literal notranslate"><span class="pre">GaussianElement</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYRationalField.from_QQ_gmpy">
<span class="sig-name descname"><span class="pre">from_QQ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyrationalfield.py#L61-L63"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYRationalField.from_QQ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a GMPY <code class="docutils literal notranslate"><span class="pre">mpq</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYRationalField.from_QQ_python">
<span class="sig-name descname"><span class="pre">from_QQ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyrationalfield.py#L53-L55"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYRationalField.from_QQ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">Fraction</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYRationalField.from_RealField">
<span class="sig-name descname"><span class="pre">from_RealField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyrationalfield.py#L70-L72"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYRationalField.from_RealField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a mpmath <code class="docutils literal notranslate"><span class="pre">mpf</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYRationalField.from_ZZ_gmpy">
<span class="sig-name descname"><span class="pre">from_ZZ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyrationalfield.py#L57-L59"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYRationalField.from_ZZ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a GMPY <code class="docutils literal notranslate"><span class="pre">mpz</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYRationalField.from_ZZ_python">
<span class="sig-name descname"><span class="pre">from_ZZ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyrationalfield.py#L49-L51"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYRationalField.from_ZZ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">int</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYRationalField.from_sympy">
<span class="sig-name descname"><span class="pre">from_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyrationalfield.py#L39-L47"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYRationalField.from_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert SymPy’s Integer to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYRationalField.get_ring">
<span class="sig-name descname"><span class="pre">get_ring</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyrationalfield.py#L29-L32"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYRationalField.get_ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns ring associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYRationalField.numer">
<span class="sig-name descname"><span class="pre">numer</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyrationalfield.py#L90-L92"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYRationalField.numer" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns numerator of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYRationalField.quo">
<span class="sig-name descname"><span class="pre">quo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyrationalfield.py#L78-L80"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYRationalField.quo" title="Permalink to this definition">¶</a></dt>
<dd><p>Quotient of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies <code class="docutils literal notranslate"><span class="pre">__truediv__</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYRationalField.rem">
<span class="sig-name descname"><span class="pre">rem</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyrationalfield.py#L82-L84"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYRationalField.rem" title="Permalink to this definition">¶</a></dt>
<dd><p>Remainder of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, implies nothing.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.GMPYRationalField.to_sympy">
<span class="sig-name descname"><span class="pre">to_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gmpyrationalfield.py#L34-L37"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.GMPYRationalField.to_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">a</span></code> to a SymPy object.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.external.pythonmpq.PythonMPQ">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.external.pythonmpq.</span></span><span class="sig-name descname"><span class="pre">PythonMPQ</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">numerator</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">denominator</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/external/pythonmpq.py#L45-L352"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.external.pythonmpq.PythonMPQ" title="Permalink to this definition">¶</a></dt>
<dd><p>Rational number implementation that is intended to be compatible with
gmpy2’s mpq.</p>
<p>Also slightly faster than fractions.Fraction.</p>
<p>PythonMPQ should be treated as immutable although no effort is made to
prevent mutation (since that might slow down calculations).</p>
</dd></dl>

</section>
<section id="mpq">
<span id="id4"></span><h2>MPQ<a class="headerlink" href="#mpq" title="Permalink to this headline">¶</a></h2>
<p>The <code class="docutils literal notranslate"><span class="pre">MPQ</span></code> type is either <a class="reference internal" href="#sympy.external.pythonmpq.PythonMPQ" title="sympy.external.pythonmpq.PythonMPQ"><code class="xref py py-class docutils literal notranslate"><span class="pre">PythonMPQ</span></code></a> or otherwise the <code class="docutils literal notranslate"><span class="pre">mpq</span></code>
type from <code class="docutils literal notranslate"><span class="pre">gmpy2</span></code>.</p>
</section>
<section id="gaussian-domains">
<h2>Gaussian domains<a class="headerlink" href="#gaussian-domains" title="Permalink to this headline">¶</a></h2>
<p>The Gaussian domains <a class="reference internal" href="#zz-i"><span class="std std-ref">ZZ_I</span></a> and <a class="reference internal" href="#qq-i"><span class="std std-ref">QQ_I</span></a> share common superclasses
<a class="reference internal" href="#sympy.polys.domains.gaussiandomains.GaussianElement" title="sympy.polys.domains.gaussiandomains.GaussianElement"><code class="xref py py-class docutils literal notranslate"><span class="pre">GaussianElement</span></code></a> for the domain elements and
<a class="reference internal" href="#sympy.polys.domains.gaussiandomains.GaussianDomain" title="sympy.polys.domains.gaussiandomains.GaussianDomain"><code class="xref py py-class docutils literal notranslate"><span class="pre">GaussianDomain</span></code></a> for the domains themselves.</p>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianDomain">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.gaussiandomains.</span></span><span class="sig-name descname"><span class="pre">GaussianDomain</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L244-L323"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianDomain" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for Gaussian domains.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianDomain.from_AlgebraicField">
<span class="sig-name descname"><span class="pre">from_AlgebraicField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L320-L323"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianDomain.from_AlgebraicField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert an element from ZZ&lt;I&gt; or QQ&lt;I&gt; to <code class="docutils literal notranslate"><span class="pre">self.dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianDomain.from_QQ">
<span class="sig-name descname"><span class="pre">from_QQ</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L308-L310"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianDomain.from_QQ" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a GMPY mpq to <code class="docutils literal notranslate"><span class="pre">self.dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianDomain.from_QQ_gmpy">
<span class="sig-name descname"><span class="pre">from_QQ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L312-L314"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianDomain.from_QQ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a GMPY mpq to <code class="docutils literal notranslate"><span class="pre">self.dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianDomain.from_QQ_python">
<span class="sig-name descname"><span class="pre">from_QQ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L316-L318"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianDomain.from_QQ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a QQ_python element to <code class="docutils literal notranslate"><span class="pre">self.dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianDomain.from_ZZ">
<span class="sig-name descname"><span class="pre">from_ZZ</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L300-L302"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianDomain.from_ZZ" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a ZZ_python element to <code class="docutils literal notranslate"><span class="pre">self.dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianDomain.from_ZZ_gmpy">
<span class="sig-name descname"><span class="pre">from_ZZ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L296-L298"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianDomain.from_ZZ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a GMPY mpz to <code class="docutils literal notranslate"><span class="pre">self.dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianDomain.from_ZZ_python">
<span class="sig-name descname"><span class="pre">from_ZZ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L304-L306"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianDomain.from_ZZ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a ZZ_python element to <code class="docutils literal notranslate"><span class="pre">self.dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianDomain.from_sympy">
<span class="sig-name descname"><span class="pre">from_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L259-L270"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianDomain.from_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a SymPy object to <code class="docutils literal notranslate"><span class="pre">self.dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianDomain.inject">
<span class="sig-name descname"><span class="pre">inject</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">gens</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L272-L274"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianDomain.inject" title="Permalink to this definition">¶</a></dt>
<dd><p>Inject generators into this domain.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianDomain.is_negative">
<span class="sig-name descname"><span class="pre">is_negative</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L280-L282"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianDomain.is_negative" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">False</span></code> for any <code class="docutils literal notranslate"><span class="pre">GaussianElement</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianDomain.is_nonnegative">
<span class="sig-name descname"><span class="pre">is_nonnegative</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L288-L290"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianDomain.is_nonnegative" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">False</span></code> for any <code class="docutils literal notranslate"><span class="pre">GaussianElement</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianDomain.is_nonpositive">
<span class="sig-name descname"><span class="pre">is_nonpositive</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L292-L294"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianDomain.is_nonpositive" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">False</span></code> for any <code class="docutils literal notranslate"><span class="pre">GaussianElement</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianDomain.is_positive">
<span class="sig-name descname"><span class="pre">is_positive</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L284-L286"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianDomain.is_positive" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">False</span></code> for any <code class="docutils literal notranslate"><span class="pre">GaussianElement</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianDomain.to_sympy">
<span class="sig-name descname"><span class="pre">to_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L254-L257"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianDomain.to_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">a</span></code> to a SymPy object.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianElement">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.gaussiandomains.</span></span><span class="sig-name descname"><span class="pre">GaussianElement</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L14-L166"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianElement" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for elements of Gaussian type domains.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianElement.new">
<em class="property"><span class="pre">classmethod</span> </em><span class="sig-name descname"><span class="pre">new</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L25-L31"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianElement.new" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a new GaussianElement of the same domain.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianElement.parent">
<span class="sig-name descname"><span class="pre">parent</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L33-L35"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianElement.parent" title="Permalink to this definition">¶</a></dt>
<dd><p>The domain that this is an element of (ZZ_I or QQ_I)</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianElement.quadrant">
<span class="sig-name descname"><span class="pre">quadrant</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L124-L134"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianElement.quadrant" title="Permalink to this definition">¶</a></dt>
<dd><p>Return quadrant index 0-3.</p>
<p>0 is included in quadrant 0.</p>
</dd></dl>

</dd></dl>

</section>
<section id="zz-i">
<span id="id5"></span><h2>ZZ_I<a class="headerlink" href="#zz-i" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianIntegerRing">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.gaussiandomains.</span></span><span class="sig-name descname"><span class="pre">GaussianIntegerRing</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L326-L475"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianIntegerRing" title="Permalink to this definition">¶</a></dt>
<dd><p>Ring of Gaussian integers <code class="docutils literal notranslate"><span class="pre">ZZ_I</span></code></p>
<p>The <a class="reference internal" href="#zz-i"><span class="std std-ref">ZZ_I</span></a> domain represents the <a class="reference external" href="https://en.wikipedia.org/wiki/Gaussian_integer">Gaussian integers</a> <span class="math notranslate nohighlight">\(\mathbb{Z}[i]\)</span>
as a <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> in the domain system (see
<a class="reference internal" href="domainsintro.html#polys-domainsintro"><span class="std std-ref">Introducing the Domains of the poly module</span></a>).</p>
<p>By default a <a class="reference internal" href="reference.html#sympy.polys.polytools.Poly" title="sympy.polys.polytools.Poly"><code class="xref py py-class docutils literal notranslate"><span class="pre">Poly</span></code></a> created from an expression with
coefficients that are combinations of integers and <code class="docutils literal notranslate"><span class="pre">I</span></code> (<span class="math notranslate nohighlight">\(\sqrt{-1}\)</span>)
will have the domain <a class="reference internal" href="#zz-i"><span class="std std-ref">ZZ_I</span></a>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Poly</span><span class="p">,</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">I</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span>
<span class="go">Poly(x**2 + I, x, domain=&#39;ZZ_I&#39;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">.</span><span class="n">domain</span>
<span class="go">ZZ_I</span>
</pre></div>
</div>
<p>The <a class="reference internal" href="#zz-i"><span class="std std-ref">ZZ_I</span></a> domain can be used to factorise polynomials that are
reducible over the Gaussian integers.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">factor</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">x**2 + 1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">domain</span><span class="o">=</span><span class="s1">&#39;ZZ_I&#39;</span><span class="p">)</span>
<span class="go">(x - I)*(x + I)</span>
</pre></div>
</div>
<p>The corresponding <a class="reference external" href="https://en.wikipedia.org/wiki/Field_of_fractions">field of fractions</a> is the domain of the Gaussian
rationals <a class="reference internal" href="#qq-i"><span class="std std-ref">QQ_I</span></a>. Conversely <a class="reference internal" href="#zz-i"><span class="std std-ref">ZZ_I</span></a> is the <a class="reference external" href="https://en.wikipedia.org/wiki/Ring_of_integers">ring of integers</a>
of <a class="reference internal" href="#qq-i"><span class="std std-ref">QQ_I</span></a>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ_I</span><span class="p">,</span> <span class="n">QQ_I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ_I</span><span class="o">.</span><span class="n">get_field</span><span class="p">()</span>
<span class="go">QQ_I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ_I</span><span class="o">.</span><span class="n">get_ring</span><span class="p">()</span>
<span class="go">ZZ_I</span>
</pre></div>
</div>
<p>When using the domain directly <a class="reference internal" href="#zz-i"><span class="std std-ref">ZZ_I</span></a> can be used as a constructor.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ_I</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span>
<span class="go">(3 + 4*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ_I</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span>
<span class="go">(5 + 0*I)</span>
</pre></div>
</div>
<p>The domain elements of <a class="reference internal" href="#zz-i"><span class="std std-ref">ZZ_I</span></a> are instances of
<a class="reference internal" href="#sympy.polys.domains.gaussiandomains.GaussianInteger" title="sympy.polys.domains.gaussiandomains.GaussianInteger"><code class="xref py py-class docutils literal notranslate"><span class="pre">GaussianInteger</span></code></a> which support the rings operations
<code class="docutils literal notranslate"><span class="pre">+,-,*,**</span></code>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">z1</span> <span class="o">=</span> <span class="n">ZZ_I</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z2</span> <span class="o">=</span> <span class="n">ZZ_I</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z1</span>
<span class="go">(5 + 1*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z2</span>
<span class="go">(2 + 3*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z1</span> <span class="o">+</span> <span class="n">z2</span>
<span class="go">(7 + 4*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z1</span> <span class="o">*</span> <span class="n">z2</span>
<span class="go">(7 + 17*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z1</span> <span class="o">**</span> <span class="mi">2</span>
<span class="go">(24 + 10*I)</span>
</pre></div>
</div>
<p>Both floor (<code class="docutils literal notranslate"><span class="pre">//</span></code>) and modulo (<code class="docutils literal notranslate"><span class="pre">%</span></code>) division work with
<a class="reference internal" href="#sympy.polys.domains.gaussiandomains.GaussianInteger" title="sympy.polys.domains.gaussiandomains.GaussianInteger"><code class="xref py py-class docutils literal notranslate"><span class="pre">GaussianInteger</span></code></a> (see the <a class="reference internal" href="#sympy.polys.domains.domain.Domain.div" title="sympy.polys.domains.domain.Domain.div"><code class="xref py py-meth docutils literal notranslate"><span class="pre">div()</span></code></a> method).</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">z3</span><span class="p">,</span> <span class="n">z4</span> <span class="o">=</span> <span class="n">ZZ_I</span><span class="p">(</span><span class="mi">5</span><span class="p">),</span> <span class="n">ZZ_I</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z3</span> <span class="o">//</span> <span class="n">z4</span>  <span class="c1"># floor division</span>
<span class="go">(1 + -1*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z3</span> <span class="o">%</span> <span class="n">z4</span>   <span class="c1"># modulo division (remainder)</span>
<span class="go">(1 + -2*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="p">(</span><span class="n">z3</span><span class="o">//</span><span class="n">z4</span><span class="p">)</span><span class="o">*</span><span class="n">z4</span> <span class="o">+</span> <span class="n">z3</span><span class="o">%</span><span class="n">z4</span> <span class="o">==</span> <span class="n">z3</span>
<span class="go">True</span>
</pre></div>
</div>
<p>True division (<code class="docutils literal notranslate"><span class="pre">/</span></code>) in <a class="reference internal" href="#zz-i"><span class="std std-ref">ZZ_I</span></a> gives an element of <a class="reference internal" href="#qq-i"><span class="std std-ref">QQ_I</span></a>. The
<a class="reference internal" href="#sympy.polys.domains.domain.Domain.exquo" title="sympy.polys.domains.domain.Domain.exquo"><code class="xref py py-meth docutils literal notranslate"><span class="pre">exquo()</span></code></a> method can be used to divide in <a class="reference internal" href="#zz-i"><span class="std std-ref">ZZ_I</span></a> when
exact division is possible.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">z1</span> <span class="o">/</span> <span class="n">z2</span>
<span class="go">(1 + -1*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ_I</span><span class="o">.</span><span class="n">exquo</span><span class="p">(</span><span class="n">z1</span><span class="p">,</span> <span class="n">z2</span><span class="p">)</span>
<span class="go">(1 + -1*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z3</span> <span class="o">/</span> <span class="n">z4</span>
<span class="go">(1/2 + -3/2*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ_I</span><span class="o">.</span><span class="n">exquo</span><span class="p">(</span><span class="n">z3</span><span class="p">,</span> <span class="n">z4</span><span class="p">)</span>
<span class="gt">Traceback (most recent call last):</span>
    <span class="o">...</span>
<span class="gr">ExactQuotientFailed</span>: <span class="n">(1 + 3*I) does not divide (5 + 0*I) in ZZ_I</span>
</pre></div>
</div>
<p>The <a class="reference internal" href="#sympy.polys.domains.domain.Domain.gcd" title="sympy.polys.domains.domain.Domain.gcd"><code class="xref py py-meth docutils literal notranslate"><span class="pre">gcd()</span></code></a> method can be used to compute the <a class="reference external" href="https://en.wikipedia.org/wiki/Greatest_common_divisor">gcd</a> of any
two elements.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ_I</span><span class="o">.</span><span class="n">gcd</span><span class="p">(</span><span class="n">ZZ_I</span><span class="p">(</span><span class="mi">10</span><span class="p">),</span> <span class="n">ZZ_I</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">(2 + 0*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ_I</span><span class="o">.</span><span class="n">gcd</span><span class="p">(</span><span class="n">ZZ_I</span><span class="p">(</span><span class="mi">5</span><span class="p">),</span> <span class="n">ZZ_I</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span>
<span class="go">(2 + 1*I)</span>
</pre></div>
</div>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianIntegerRing.dtype">
<span class="sig-name descname"><span class="pre">dtype</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L169-L206"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianIntegerRing.dtype" title="Permalink to this definition">¶</a></dt>
<dd><p>alias of <a class="reference internal" href="#sympy.polys.domains.gaussiandomains.GaussianInteger" title="sympy.polys.domains.gaussiandomains.GaussianInteger"><code class="xref py py-class docutils literal notranslate"><span class="pre">sympy.polys.domains.gaussiandomains.GaussianInteger</span></code></a></p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianIntegerRing.from_GaussianIntegerRing">
<span class="sig-name descname"><span class="pre">from_GaussianIntegerRing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L469-L471"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianIntegerRing.from_GaussianIntegerRing" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a ZZ_I element to ZZ_I.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianIntegerRing.from_GaussianRationalField">
<span class="sig-name descname"><span class="pre">from_GaussianRationalField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L473-L475"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianIntegerRing.from_GaussianRationalField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a QQ_I element to ZZ_I.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianIntegerRing.gcd">
<span class="sig-name descname"><span class="pre">gcd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L459-L463"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianIntegerRing.gcd" title="Permalink to this definition">¶</a></dt>
<dd><p>Greatest common divisor of a and b over ZZ_I.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianIntegerRing.get_field">
<span class="sig-name descname"><span class="pre">get_field</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L445-L447"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianIntegerRing.get_field" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a field associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianIntegerRing.get_ring">
<span class="sig-name descname"><span class="pre">get_ring</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L441-L443"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianIntegerRing.get_ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a ring associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianIntegerRing.lcm">
<span class="sig-name descname"><span class="pre">lcm</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L465-L467"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianIntegerRing.lcm" title="Permalink to this definition">¶</a></dt>
<dd><p>Least common multiple of a and b over ZZ_I.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianIntegerRing.normalize">
<span class="sig-name descname"><span class="pre">normalize</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">d</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L449-L457"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianIntegerRing.normalize" title="Permalink to this definition">¶</a></dt>
<dd><p>Return first quadrant element associated with <code class="docutils literal notranslate"><span class="pre">d</span></code>.</p>
<p>Also multiply the other arguments by the same power of i.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianInteger">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.gaussiandomains.</span></span><span class="sig-name descname"><span class="pre">GaussianInteger</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L169-L206"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianInteger" title="Permalink to this definition">¶</a></dt>
<dd><p>Gaussian integer: domain element for <a class="reference internal" href="#zz-i"><span class="std std-ref">ZZ_I</span></a></p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ_I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z</span> <span class="o">=</span> <span class="n">ZZ_I</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z</span>
<span class="go">(2 + 3*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">&lt;class &#39;sympy.polys.domains.gaussiandomains.GaussianInteger&#39;&gt;</span>
</pre></div>
</div>
</dd></dl>

</section>
<section id="qq-i">
<span id="id6"></span><h2>QQ_I<a class="headerlink" href="#qq-i" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianRationalField">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.gaussiandomains.</span></span><span class="sig-name descname"><span class="pre">GaussianRationalField</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L480-L643"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianRationalField" title="Permalink to this definition">¶</a></dt>
<dd><p>Field of Gaussian rationals <code class="docutils literal notranslate"><span class="pre">QQ_I</span></code></p>
<p>The <a class="reference internal" href="#qq-i"><span class="std std-ref">QQ_I</span></a> domain represents the <a class="reference external" href="https://en.wikipedia.org/wiki/Gaussian_rational">Gaussian rationals</a> <span class="math notranslate nohighlight">\(\mathbb{Q}(i)\)</span>
as a <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> in the domain system (see
<a class="reference internal" href="domainsintro.html#polys-domainsintro"><span class="std std-ref">Introducing the Domains of the poly module</span></a>).</p>
<p>By default a <a class="reference internal" href="reference.html#sympy.polys.polytools.Poly" title="sympy.polys.polytools.Poly"><code class="xref py py-class docutils literal notranslate"><span class="pre">Poly</span></code></a> created from an expression with
coefficients that are combinations of rationals and <code class="docutils literal notranslate"><span class="pre">I</span></code> (<span class="math notranslate nohighlight">\(\sqrt{-1}\)</span>)
will have the domain <a class="reference internal" href="#qq-i"><span class="std std-ref">QQ_I</span></a>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Poly</span><span class="p">,</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">I</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span>
<span class="go">Poly(x**2 + I/2, x, domain=&#39;QQ_I&#39;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">.</span><span class="n">domain</span>
<span class="go">QQ_I</span>
</pre></div>
</div>
<p>The polys option <code class="docutils literal notranslate"><span class="pre">gaussian=True</span></code> can be used to specify that the domain
should be <a class="reference internal" href="#qq-i"><span class="std std-ref">QQ_I</span></a> even if the coefficients do not contain <code class="docutils literal notranslate"><span class="pre">I</span></code> or are
all integers.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>
<span class="go">Poly(x**2, x, domain=&#39;ZZ&#39;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">I</span><span class="p">)</span>
<span class="go">Poly(x**2 + I, x, domain=&#39;ZZ_I&#39;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span>
<span class="go">Poly(1/2*x**2, x, domain=&#39;QQ&#39;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">gaussian</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="go">Poly(x**2, x, domain=&#39;QQ_I&#39;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">I</span><span class="p">,</span> <span class="n">gaussian</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="go">Poly(x**2 + I, x, domain=&#39;QQ_I&#39;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="n">gaussian</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="go">Poly(1/2*x**2, x, domain=&#39;QQ_I&#39;)</span>
</pre></div>
</div>
<p>The <a class="reference internal" href="#qq-i"><span class="std std-ref">QQ_I</span></a> domain can be used to factorise polynomials that are
reducible over the Gaussian rationals.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">factor</span><span class="p">,</span> <span class="n">QQ_I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">/</span><span class="mi">4</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">(x**2 + 4)/4</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">/</span><span class="mi">4</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">domain</span><span class="o">=</span><span class="s1">&#39;QQ_I&#39;</span><span class="p">)</span>
<span class="go">(x - 2*I)*(x + 2*I)/4</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">/</span><span class="mi">4</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">domain</span><span class="o">=</span><span class="n">QQ_I</span><span class="p">)</span>
<span class="go">(x - 2*I)*(x + 2*I)/4</span>
</pre></div>
</div>
<p>It is also possible to specify the <a class="reference internal" href="#qq-i"><span class="std std-ref">QQ_I</span></a> domain explicitly with
polys functions like <a class="reference internal" href="reference.html#sympy.polys.partfrac.apart" title="sympy.polys.partfrac.apart"><code class="xref py py-func docutils literal notranslate"><span class="pre">apart()</span></code></a>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">apart</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">apart</span><span class="p">(</span><span class="mi">1</span><span class="o">/</span><span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">))</span>
<span class="go">1/(x**2 + 1)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">apart</span><span class="p">(</span><span class="mi">1</span><span class="o">/</span><span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">),</span> <span class="n">domain</span><span class="o">=</span><span class="n">QQ_I</span><span class="p">)</span>
<span class="go">I/(2*(x + I)) - I/(2*(x - I))</span>
</pre></div>
</div>
<p>The corresponding <a class="reference external" href="https://en.wikipedia.org/wiki/Ring_of_integers">ring of integers</a> is the domain of the Gaussian
integers <a class="reference internal" href="#zz-i"><span class="std std-ref">ZZ_I</span></a>. Conversely <a class="reference internal" href="#qq-i"><span class="std std-ref">QQ_I</span></a> is the <a class="reference external" href="https://en.wikipedia.org/wiki/Field_of_fractions">field of fractions</a>
of <a class="reference internal" href="#zz-i"><span class="std std-ref">ZZ_I</span></a>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ZZ_I</span><span class="p">,</span> <span class="n">QQ_I</span><span class="p">,</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ZZ_I</span><span class="o">.</span><span class="n">get_field</span><span class="p">()</span>
<span class="go">QQ_I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ_I</span><span class="o">.</span><span class="n">get_ring</span><span class="p">()</span>
<span class="go">ZZ_I</span>
</pre></div>
</div>
<p>When using the domain directly <a class="reference internal" href="#qq-i"><span class="std std-ref">QQ_I</span></a> can be used as a constructor.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">QQ_I</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span>
<span class="go">(3 + 4*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ_I</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span>
<span class="go">(5 + 0*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ_I</span><span class="p">(</span><span class="n">QQ</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="n">QQ</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">))</span>
<span class="go">(2/3 + 4/5*I)</span>
</pre></div>
</div>
<p>The domain elements of <a class="reference internal" href="#qq-i"><span class="std std-ref">QQ_I</span></a> are instances of
<a class="reference internal" href="#sympy.polys.domains.gaussiandomains.GaussianRational" title="sympy.polys.domains.gaussiandomains.GaussianRational"><code class="xref py py-class docutils literal notranslate"><span class="pre">GaussianRational</span></code></a> which support the field operations
<code class="docutils literal notranslate"><span class="pre">+,-,*,**,/</span></code>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">z1</span> <span class="o">=</span> <span class="n">QQ_I</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z2</span> <span class="o">=</span> <span class="n">QQ_I</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="n">QQ</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z1</span>
<span class="go">(5 + 1*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z2</span>
<span class="go">(2 + 1/2*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z1</span> <span class="o">+</span> <span class="n">z2</span>
<span class="go">(7 + 3/2*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z1</span> <span class="o">*</span> <span class="n">z2</span>
<span class="go">(19/2 + 9/2*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z2</span> <span class="o">**</span> <span class="mi">2</span>
<span class="go">(15/4 + 2*I)</span>
</pre></div>
</div>
<p>True division (<code class="docutils literal notranslate"><span class="pre">/</span></code>) in <a class="reference internal" href="#qq-i"><span class="std std-ref">QQ_I</span></a> gives an element of <a class="reference internal" href="#qq-i"><span class="std std-ref">QQ_I</span></a> and
is always exact.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">z1</span> <span class="o">/</span> <span class="n">z2</span>
<span class="go">(42/17 + -2/17*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ_I</span><span class="o">.</span><span class="n">exquo</span><span class="p">(</span><span class="n">z1</span><span class="p">,</span> <span class="n">z2</span><span class="p">)</span>
<span class="go">(42/17 + -2/17*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z1</span> <span class="o">==</span> <span class="p">(</span><span class="n">z1</span><span class="o">/</span><span class="n">z2</span><span class="p">)</span><span class="o">*</span><span class="n">z2</span>
<span class="go">True</span>
</pre></div>
</div>
<p>Both floor (<code class="docutils literal notranslate"><span class="pre">//</span></code>) and modulo (<code class="docutils literal notranslate"><span class="pre">%</span></code>) division can be used with
<a class="reference internal" href="#sympy.polys.domains.gaussiandomains.GaussianRational" title="sympy.polys.domains.gaussiandomains.GaussianRational"><code class="xref py py-class docutils literal notranslate"><span class="pre">GaussianRational</span></code></a> (see <a class="reference internal" href="#sympy.polys.domains.domain.Domain.div" title="sympy.polys.domains.domain.Domain.div"><code class="xref py py-meth docutils literal notranslate"><span class="pre">div()</span></code></a>)
but division is always exact so there is no remainder.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">z1</span> <span class="o">//</span> <span class="n">z2</span>
<span class="go">(42/17 + -2/17*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z1</span> <span class="o">%</span> <span class="n">z2</span>
<span class="go">(0 + 0*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ_I</span><span class="o">.</span><span class="n">div</span><span class="p">(</span><span class="n">z1</span><span class="p">,</span> <span class="n">z2</span><span class="p">)</span>
<span class="go">((42/17 + -2/17*I), (0 + 0*I))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="p">(</span><span class="n">z1</span><span class="o">//</span><span class="n">z2</span><span class="p">)</span><span class="o">*</span><span class="n">z2</span> <span class="o">+</span> <span class="n">z1</span><span class="o">%</span><span class="n">z2</span> <span class="o">==</span> <span class="n">z1</span>
<span class="go">True</span>
</pre></div>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianRationalField.as_AlgebraicField">
<span class="sig-name descname"><span class="pre">as_AlgebraicField</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L620-L622"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianRationalField.as_AlgebraicField" title="Permalink to this definition">¶</a></dt>
<dd><p>Get equivalent domain as an <code class="docutils literal notranslate"><span class="pre">AlgebraicField</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianRationalField.denom">
<span class="sig-name descname"><span class="pre">denom</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L629-L635"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianRationalField.denom" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the denominator of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianRationalField.dtype">
<span class="sig-name descname"><span class="pre">dtype</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L209-L241"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianRationalField.dtype" title="Permalink to this definition">¶</a></dt>
<dd><p>alias of <a class="reference internal" href="#sympy.polys.domains.gaussiandomains.GaussianRational" title="sympy.polys.domains.gaussiandomains.GaussianRational"><code class="xref py py-class docutils literal notranslate"><span class="pre">sympy.polys.domains.gaussiandomains.GaussianRational</span></code></a></p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianRationalField.from_GaussianIntegerRing">
<span class="sig-name descname"><span class="pre">from_GaussianIntegerRing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L637-L639"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianRationalField.from_GaussianIntegerRing" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a ZZ_I element to QQ_I.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianRationalField.from_GaussianRationalField">
<span class="sig-name descname"><span class="pre">from_GaussianRationalField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L641-L643"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianRationalField.from_GaussianRationalField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a QQ_I element to QQ_I.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianRationalField.get_field">
<span class="sig-name descname"><span class="pre">get_field</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L616-L618"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianRationalField.get_field" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a field associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianRationalField.get_ring">
<span class="sig-name descname"><span class="pre">get_ring</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L612-L614"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianRationalField.get_ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a ring associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianRationalField.numer">
<span class="sig-name descname"><span class="pre">numer</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L624-L627"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianRationalField.numer" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the numerator of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.gaussiandomains.GaussianRational">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.gaussiandomains.</span></span><span class="sig-name descname"><span class="pre">GaussianRational</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/gaussiandomains.py#L209-L241"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.gaussiandomains.GaussianRational" title="Permalink to this definition">¶</a></dt>
<dd><p>Gaussian rational: domain element for <a class="reference internal" href="#qq-i"><span class="std std-ref">QQ_I</span></a></p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ_I</span><span class="p">,</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z</span> <span class="o">=</span> <span class="n">QQ_I</span><span class="p">(</span><span class="n">QQ</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="n">QQ</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z</span>
<span class="go">(2/3 + 4/5*I)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">&lt;class &#39;sympy.polys.domains.gaussiandomains.GaussianRational&#39;&gt;</span>
</pre></div>
</div>
</dd></dl>

</section>
<section id="qq-a">
<span id="id7"></span><h2>QQ&lt;a&gt;<a class="headerlink" href="#qq-a" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.</span></span><span class="sig-name descname"><span class="pre">AlgebraicField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dom</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">ext</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L11-L363"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField" title="Permalink to this definition">¶</a></dt>
<dd><p>Algebraic number field <a class="reference internal" href="#qq-a"><span class="std std-ref">QQ&lt;a&gt;</span></a></p>
<p>A <a class="reference internal" href="#qq-a"><span class="std std-ref">QQ&lt;a&gt;</span></a> domain represents an <a class="reference external" href="https://en.wikipedia.org/wiki/Algebraic_number_field">algebraic number field</a>
<span class="math notranslate nohighlight">\(\mathbb{Q}(a)\)</span> as a <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> in the domain system (see
<a class="reference internal" href="domainsintro.html#polys-domainsintro"><span class="std std-ref">Introducing the Domains of the poly module</span></a>).</p>
<p>A <a class="reference internal" href="reference.html#sympy.polys.polytools.Poly" title="sympy.polys.polytools.Poly"><code class="xref py py-class docutils literal notranslate"><span class="pre">Poly</span></code></a> created from an expression involving <a class="reference external" href="https://en.wikipedia.org/wiki/Algebraic_number">algebraic
numbers</a> will treat the algebraic numbers as generators if the generators
argument is not specified.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Poly</span><span class="p">,</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">sqrt</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">Poly(x**2 + (sqrt(2)), x, sqrt(2), domain=&#39;ZZ&#39;)</span>
</pre></div>
</div>
<p>That is a multivariate polynomial with <code class="docutils literal notranslate"><span class="pre">sqrt(2)</span></code> treated as one of the
generators (variables). If the generators are explicitly specified then
<code class="docutils literal notranslate"><span class="pre">sqrt(2)</span></code> will be considered to be a coefficient but by default the
<a class="reference internal" href="#ex"><span class="std std-ref">EX</span></a> domain is used. To make a <a class="reference internal" href="reference.html#sympy.polys.polytools.Poly" title="sympy.polys.polytools.Poly"><code class="xref py py-class docutils literal notranslate"><span class="pre">Poly</span></code></a> with a <a class="reference internal" href="#qq-a"><span class="std std-ref">QQ&lt;a&gt;</span></a>
domain the argument <code class="docutils literal notranslate"><span class="pre">extension=True</span></code> can be given.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">Poly(x**2 + sqrt(2), x, domain=&#39;EX&#39;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">),</span> <span class="n">x</span><span class="p">,</span> <span class="n">extension</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="go">Poly(x**2 + sqrt(2), x, domain=&#39;QQ&lt;sqrt(2)&gt;&#39;)</span>
</pre></div>
</div>
<p>A generator of the algebraic field extension can also be specified
explicitly which is particularly useful if the coefficients are all
rational but an extension field is needed (e.g. to factor the
polynomial).</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">Poly(x**2 + 1, x, domain=&#39;ZZ&#39;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">extension</span><span class="o">=</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">Poly(x**2 + 1, x, domain=&#39;QQ&lt;sqrt(2)&gt;&#39;)</span>
</pre></div>
</div>
<p>It is possible to factorise a polynomial over a <a class="reference internal" href="#qq-a"><span class="std std-ref">QQ&lt;a&gt;</span></a> domain using
the <code class="docutils literal notranslate"><span class="pre">extension</span></code> argument to <a class="reference internal" href="reference.html#sympy.polys.polytools.factor" title="sympy.polys.polytools.factor"><code class="xref py py-func docutils literal notranslate"><span class="pre">factor()</span></code></a> or by specifying the domain
explicitly.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">factor</span><span class="p">,</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">x**2 - 2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">2</span><span class="p">,</span> <span class="n">extension</span><span class="o">=</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">(x - sqrt(2))*(x + sqrt(2))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">2</span><span class="p">,</span> <span class="n">domain</span><span class="o">=</span><span class="s1">&#39;QQ&lt;sqrt(2)&gt;&#39;</span><span class="p">)</span>
<span class="go">(x - sqrt(2))*(x + sqrt(2))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">2</span><span class="p">,</span> <span class="n">domain</span><span class="o">=</span><span class="n">QQ</span><span class="o">.</span><span class="n">algebraic_field</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">)))</span>
<span class="go">(x - sqrt(2))*(x + sqrt(2))</span>
</pre></div>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">extension=True</span></code> argument can be used but will only create an
extension that contains the coefficients which is usually not enough to
factorise the polynomial.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">x</span><span class="o">**</span><span class="mi">3</span> <span class="o">+</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">*</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">2</span><span class="o">*</span><span class="n">x</span> <span class="o">-</span> <span class="mi">2</span><span class="o">*</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">p</span><span class="p">)</span>                         <span class="c1"># treats sqrt(2) as a symbol</span>
<span class="go">(x + sqrt(2))*(x**2 - 2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">extension</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="go">(x - sqrt(2))*(x + sqrt(2))**2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">2</span><span class="p">,</span> <span class="n">extension</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>  <span class="c1"># all rational coefficients</span>
<span class="go">x**2 - 2</span>
</pre></div>
</div>
<p>It is also possible to use <a class="reference internal" href="#qq-a"><span class="std std-ref">QQ&lt;a&gt;</span></a> with the <a class="reference internal" href="reference.html#sympy.polys.polytools.cancel" title="sympy.polys.polytools.cancel"><code class="xref py py-func docutils literal notranslate"><span class="pre">cancel()</span></code></a>
and <a class="reference internal" href="reference.html#sympy.polys.polytools.gcd" title="sympy.polys.polytools.gcd"><code class="xref py py-func docutils literal notranslate"><span class="pre">gcd()</span></code></a> functions.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">cancel</span><span class="p">,</span> <span class="n">gcd</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cancel</span><span class="p">((</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">2</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">)))</span>
<span class="go">(x**2 - 2)/(x - sqrt(2))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cancel</span><span class="p">((</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">2</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">)),</span> <span class="n">extension</span><span class="o">=</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">x + sqrt(2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">gcd</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">2</span><span class="p">,</span> <span class="n">x</span> <span class="o">-</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">gcd</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">2</span><span class="p">,</span> <span class="n">x</span> <span class="o">-</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">),</span> <span class="n">extension</span><span class="o">=</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">x - sqrt(2)</span>
</pre></div>
</div>
<p>When using the domain directly <a class="reference internal" href="#qq-a"><span class="std std-ref">QQ&lt;a&gt;</span></a> can be used as a constructor
to create instances which then support the operations <code class="docutils literal notranslate"><span class="pre">+,-,*,**,/</span></code>. The
<a class="reference internal" href="#sympy.polys.domains.domain.Domain.algebraic_field" title="sympy.polys.domains.domain.Domain.algebraic_field"><code class="xref py py-meth docutils literal notranslate"><span class="pre">algebraic_field()</span></code></a> method is used to construct a
particular <a class="reference internal" href="#qq-a"><span class="std std-ref">QQ&lt;a&gt;</span></a> domain. The <a class="reference internal" href="#sympy.polys.domains.domain.Domain.from_sympy" title="sympy.polys.domains.domain.Domain.from_sympy"><code class="xref py py-meth docutils literal notranslate"><span class="pre">from_sympy()</span></code></a> method
can be used to create domain elements from normal sympy expressions.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">algebraic_field</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span>
<span class="go">QQ&lt;sqrt(2)&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">xk</span> <span class="o">=</span> <span class="n">K</span><span class="o">.</span><span class="n">from_sympy</span><span class="p">(</span><span class="mi">3</span> <span class="o">+</span> <span class="mi">4</span><span class="o">*</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">xk</span>  
<span class="go">ANP([4, 3], [1, 0, -2], QQ)</span>
</pre></div>
</div>
<p>Elements of <a class="reference internal" href="#qq-a"><span class="std std-ref">QQ&lt;a&gt;</span></a> are instances of <a class="reference internal" href="#sympy.polys.polyclasses.ANP" title="sympy.polys.polyclasses.ANP"><code class="xref py py-class docutils literal notranslate"><span class="pre">ANP</span></code></a> which have
limited printing support. The raw display shows the internal
representation of the element as the list <code class="docutils literal notranslate"><span class="pre">[4,</span> <span class="pre">3]</span></code> representing the
coefficients of <code class="docutils literal notranslate"><span class="pre">1</span></code> and <code class="docutils literal notranslate"><span class="pre">sqrt(2)</span></code> for this element in the form
<code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">*</span> <span class="pre">sqrt(2)</span> <span class="pre">+</span> <span class="pre">b</span> <span class="pre">*</span> <span class="pre">1</span></code> where <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code> are elements of <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a>.
The minimal polynomial for the generator <code class="docutils literal notranslate"><span class="pre">(x**2</span> <span class="pre">-</span> <span class="pre">2)</span></code> is also shown in
the <a class="reference internal" href="domainsintro.html#dup-representation"><span class="std std-ref">DUP representation</span></a> as the list <code class="docutils literal notranslate"><span class="pre">[1,</span> <span class="pre">0,</span> <span class="pre">-2]</span></code>. We can use
<a class="reference internal" href="#sympy.polys.domains.domain.Domain.to_sympy" title="sympy.polys.domains.domain.Domain.to_sympy"><code class="xref py py-meth docutils literal notranslate"><span class="pre">to_sympy()</span></code></a> to get a better printed form for the
elements and to see the results of operations.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">xk</span> <span class="o">=</span> <span class="n">K</span><span class="o">.</span><span class="n">from_sympy</span><span class="p">(</span><span class="mi">3</span> <span class="o">+</span> <span class="mi">4</span><span class="o">*</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">yk</span> <span class="o">=</span> <span class="n">K</span><span class="o">.</span><span class="n">from_sympy</span><span class="p">(</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">xk</span> <span class="o">*</span> <span class="n">yk</span>  
<span class="go">ANP([17, 30], [1, 0, -2], QQ)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">to_sympy</span><span class="p">(</span><span class="n">xk</span> <span class="o">*</span> <span class="n">yk</span><span class="p">)</span>
<span class="go">17*sqrt(2) + 30</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">to_sympy</span><span class="p">(</span><span class="n">xk</span> <span class="o">+</span> <span class="n">yk</span><span class="p">)</span>
<span class="go">5 + 7*sqrt(2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">to_sympy</span><span class="p">(</span><span class="n">xk</span> <span class="o">**</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">24*sqrt(2) + 41</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">to_sympy</span><span class="p">(</span><span class="n">xk</span> <span class="o">/</span> <span class="n">yk</span><span class="p">)</span>
<span class="go">sqrt(2)/14 + 9/7</span>
</pre></div>
</div>
<p>Any expression representing an algebraic number can be used to generate
a <a class="reference internal" href="#qq-a"><span class="std std-ref">QQ&lt;a&gt;</span></a> domain provided its <a class="reference external" href="https://en.wikipedia.org/wiki/Minimal_polynomial_(field_theory)">minimal polynomial</a> can be computed.
The function <a class="reference internal" href="reference.html#sympy.polys.numberfields.minpoly" title="sympy.polys.numberfields.minpoly"><code class="xref py py-func docutils literal notranslate"><span class="pre">minpoly()</span></code></a> function is used for this.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">exp</span><span class="p">,</span> <span class="n">I</span><span class="p">,</span> <span class="n">pi</span><span class="p">,</span> <span class="n">minpoly</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">g</span> <span class="o">=</span> <span class="n">exp</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">I</span><span class="o">*</span><span class="n">pi</span><span class="o">/</span><span class="mi">3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">g</span>
<span class="go">exp(2*I*pi/3)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">g</span><span class="o">.</span><span class="n">is_algebraic</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">minpoly</span><span class="p">(</span><span class="n">g</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">x**2 + x + 1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">3</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> <span class="n">extension</span><span class="o">=</span><span class="n">g</span><span class="p">)</span>
<span class="go">(x - 1)*(x - exp(2*I*pi/3))*(x + 1 + exp(2*I*pi/3))</span>
</pre></div>
</div>
<p>It is also possible to make an algebraic field from multiple extension
elements.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">algebraic_field</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">),</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">3</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span>
<span class="go">QQ&lt;sqrt(2) + sqrt(3)&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">x</span><span class="o">**</span><span class="mi">4</span> <span class="o">-</span> <span class="mi">5</span><span class="o">*</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">6</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">p</span><span class="p">)</span>
<span class="go">(x**2 - 3)*(x**2 - 2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">domain</span><span class="o">=</span><span class="n">K</span><span class="p">)</span>
<span class="go">(x - sqrt(2))*(x + sqrt(2))*(x - sqrt(3))*(x + sqrt(3))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">factor</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">extension</span><span class="o">=</span><span class="p">[</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">),</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">3</span><span class="p">)])</span>
<span class="go">(x - sqrt(2))*(x + sqrt(2))*(x - sqrt(3))*(x + sqrt(3))</span>
</pre></div>
</div>
<p>Multiple extension elements are always combined together to make a single
<a class="reference external" href="https://en.wikipedia.org/wiki/Primitive_element_theorem">primitive element</a>. In the case of <code class="docutils literal notranslate"><span class="pre">[sqrt(2),</span> <span class="pre">sqrt(3)]</span></code> the primitive
element chosen is <code class="docutils literal notranslate"><span class="pre">sqrt(2)</span> <span class="pre">+</span> <span class="pre">sqrt(3)</span></code> which is why the domain displays
as <code class="docutils literal notranslate"><span class="pre">QQ&lt;sqrt(2)</span> <span class="pre">+</span> <span class="pre">sqrt(3)&gt;</span></code>. The minimal polynomial for the primitive
element is computed using the <a class="reference internal" href="reference.html#sympy.polys.numberfields.primitive_element" title="sympy.polys.numberfields.primitive_element"><code class="xref py py-func docutils literal notranslate"><span class="pre">primitive_element()</span></code></a> function.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">primitive_element</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">primitive_element</span><span class="p">([</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">),</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">3</span><span class="p">)],</span> <span class="n">x</span><span class="p">)</span>
<span class="go">(x**4 - 10*x**2 + 1, [1, 1])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">minpoly</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> <span class="o">+</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">3</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">x**4 - 10*x**2 + 1</span>
</pre></div>
</div>
<p>The extension elements that generate the domain can be accessed from the
domain using the <a class="reference internal" href="#sympy.polys.domains.AlgebraicField.ext" title="sympy.polys.domains.AlgebraicField.ext"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ext</span></code></a> and <a class="reference internal" href="#sympy.polys.domains.AlgebraicField.orig_ext" title="sympy.polys.domains.AlgebraicField.orig_ext"><code class="xref py py-attr docutils literal notranslate"><span class="pre">orig_ext</span></code></a> attributes as
instances of <a class="reference internal" href="reference.html#sympy.polys.numberfields.AlgebraicNumber" title="sympy.polys.numberfields.AlgebraicNumber"><code class="xref py py-class docutils literal notranslate"><span class="pre">AlgebraicNumber</span></code></a>. The minimal polynomial for
the primitive element as a <a class="reference internal" href="#sympy.polys.polyclasses.DMP" title="sympy.polys.polyclasses.DMP"><code class="xref py py-class docutils literal notranslate"><span class="pre">DMP</span></code></a> instance is available as
<a class="reference internal" href="#sympy.polys.domains.AlgebraicField.mod" title="sympy.polys.domains.AlgebraicField.mod"><code class="xref py py-attr docutils literal notranslate"><span class="pre">mod</span></code></a>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">algebraic_field</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">),</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">3</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span>
<span class="go">QQ&lt;sqrt(2) + sqrt(3)&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">ext</span>
<span class="go">sqrt(2) + sqrt(3)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">orig_ext</span>
<span class="go">(sqrt(2), sqrt(3))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">mod</span>
<span class="go">DMP([1, 0, -10, 0, 1], QQ, None)</span>
</pre></div>
</div>
<p class="rubric">Notes</p>
<p>It is not currently possible to generate an algebraic extension over any
domain other than <a class="reference internal" href="#qq"><span class="std std-ref">QQ</span></a>. Ideally it would be possible to generate
extensions like <code class="docutils literal notranslate"><span class="pre">QQ(x)(sqrt(x**2</span> <span class="pre">-</span> <span class="pre">2))</span></code>. This is equivalent to the
quotient ring <code class="docutils literal notranslate"><span class="pre">QQ(x)[y]/(y**2</span> <span class="pre">-</span> <span class="pre">x**2</span> <span class="pre">+</span> <span class="pre">2)</span></code> and there are two
implementations of this kind of quotient ring/extension in the
<a class="reference internal" href="#sympy.polys.domains.quotientring.QuotientRing" title="sympy.polys.domains.quotientring.QuotientRing"><code class="xref py py-class docutils literal notranslate"><span class="pre">QuotientRing</span></code></a> and <a class="reference internal" href="agca.html#sympy.polys.agca.extensions.MonogenicFiniteExtension" title="sympy.polys.agca.extensions.MonogenicFiniteExtension"><code class="xref py py-class docutils literal notranslate"><span class="pre">MonogenicFiniteExtension</span></code></a>
classes.  Each of those implementations needs some work to make them fully
usable though.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.algebraic_field">
<span class="sig-name descname"><span class="pre">algebraic_field</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">extension</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L270-L272"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.algebraic_field" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an algebraic field, i.e. <span class="math notranslate nohighlight">\(\mathbb{Q}(\alpha, \ldots)\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.denom">
<span class="sig-name descname"><span class="pre">denom</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L349-L351"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.denom" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns denominator of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.dtype">
<span class="sig-name descname"><span class="pre">dtype</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1505-L1767"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.dtype" title="Permalink to this definition">¶</a></dt>
<dd><p>alias of <a class="reference internal" href="#sympy.polys.polyclasses.ANP" title="sympy.polys.polyclasses.ANP"><code class="xref py py-class docutils literal notranslate"><span class="pre">sympy.polys.polyclasses.ANP</span></code></a></p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.ext">
<span class="sig-name descname"><span class="pre">ext</span></span><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.ext" title="Permalink to this definition">¶</a></dt>
<dd><p>Primitive element used for the extension.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span><span class="p">,</span> <span class="n">sqrt</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">algebraic_field</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">),</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">3</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">ext</span>
<span class="go">sqrt(2) + sqrt(3)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.from_AlgebraicField">
<span class="sig-name descname"><span class="pre">from_AlgebraicField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L353-L355"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.from_AlgebraicField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert AlgebraicField element ‘a’ to another AlgebraicField</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.from_GaussianIntegerRing">
<span class="sig-name descname"><span class="pre">from_GaussianIntegerRing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L357-L359"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.from_GaussianIntegerRing" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a GaussianInteger element ‘a’ to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.from_GaussianRationalField">
<span class="sig-name descname"><span class="pre">from_GaussianRationalField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L361-L363"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.from_GaussianRationalField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a GaussianRational element ‘a’ to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.from_QQ">
<span class="sig-name descname"><span class="pre">from_QQ</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L305-L307"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.from_QQ" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">Fraction</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.from_QQ_gmpy">
<span class="sig-name descname"><span class="pre">from_QQ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L317-L319"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.from_QQ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a GMPY <code class="docutils literal notranslate"><span class="pre">mpq</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.from_QQ_python">
<span class="sig-name descname"><span class="pre">from_QQ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L309-L311"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.from_QQ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">Fraction</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.from_RealField">
<span class="sig-name descname"><span class="pre">from_RealField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L321-L323"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.from_RealField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a mpmath <code class="docutils literal notranslate"><span class="pre">mpf</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.from_ZZ">
<span class="sig-name descname"><span class="pre">from_ZZ</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L297-L299"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.from_ZZ" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">int</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.from_ZZ_gmpy">
<span class="sig-name descname"><span class="pre">from_ZZ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L313-L315"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.from_ZZ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a GMPY <code class="docutils literal notranslate"><span class="pre">mpz</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.from_ZZ_python">
<span class="sig-name descname"><span class="pre">from_ZZ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L301-L303"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.from_ZZ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">int</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.from_sympy">
<span class="sig-name descname"><span class="pre">from_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L282-L295"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.from_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert SymPy’s expression to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.get_ring">
<span class="sig-name descname"><span class="pre">get_ring</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L325-L327"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.get_ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a ring associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.is_negative">
<span class="sig-name descname"><span class="pre">is_negative</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L333-L335"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.is_negative" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">a</span></code> is negative.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.is_nonnegative">
<span class="sig-name descname"><span class="pre">is_nonnegative</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L341-L343"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.is_nonnegative" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">a</span></code> is non-negative.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.is_nonpositive">
<span class="sig-name descname"><span class="pre">is_nonpositive</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L337-L339"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.is_nonpositive" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">a</span></code> is non-positive.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.is_positive">
<span class="sig-name descname"><span class="pre">is_positive</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L329-L331"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.is_positive" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">a</span></code> is positive.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.mod">
<span class="sig-name descname"><span class="pre">mod</span></span><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.mod" title="Permalink to this definition">¶</a></dt>
<dd><p>Minimal polynomial for the primitive element of the extension.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span><span class="p">,</span> <span class="n">sqrt</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">algebraic_field</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">mod</span>
<span class="go">DMP([1, 0, -2], QQ, None)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.numer">
<span class="sig-name descname"><span class="pre">numer</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L345-L347"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.numer" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns numerator of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.orig_ext">
<span class="sig-name descname"><span class="pre">orig_ext</span></span><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.orig_ext" title="Permalink to this definition">¶</a></dt>
<dd><p>Original elements given to generate the extension.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span><span class="p">,</span> <span class="n">sqrt</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">algebraic_field</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">),</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">3</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">orig_ext</span>
<span class="go">(sqrt(2), sqrt(3))</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.AlgebraicField.to_sympy">
<span class="sig-name descname"><span class="pre">to_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/algebraicfield.py#L274-L280"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.AlgebraicField.to_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">a</span></code> to a SymPy object.</p>
</dd></dl>

</dd></dl>

</section>
<section id="rr">
<span id="id8"></span><h2>RR<a class="headerlink" href="#rr" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.RealField">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.</span></span><span class="sig-name descname"><span class="pre">RealField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">prec</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">53</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dps</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tol</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/realfield.py#L12-L129"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RealField" title="Permalink to this definition">¶</a></dt>
<dd><p>Real numbers up to the given precision.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RealField.almosteq">
<span class="sig-name descname"><span class="pre">almosteq</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tolerance</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/realfield.py#L127-L129"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RealField.almosteq" title="Permalink to this definition">¶</a></dt>
<dd><p>Check if <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code> are almost equal.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RealField.from_sympy">
<span class="sig-name descname"><span class="pre">from_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">expr</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/realfield.py#L66-L73"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RealField.from_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert SymPy’s number to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RealField.gcd">
<span class="sig-name descname"><span class="pre">gcd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/realfield.py#L119-L121"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RealField.gcd" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns GCD of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RealField.get_exact">
<span class="sig-name descname"><span class="pre">get_exact</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/realfield.py#L114-L117"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RealField.get_exact" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an exact domain associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RealField.get_ring">
<span class="sig-name descname"><span class="pre">get_ring</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/realfield.py#L110-L112"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RealField.get_ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a ring associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RealField.lcm">
<span class="sig-name descname"><span class="pre">lcm</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/realfield.py#L123-L125"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RealField.lcm" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns LCM of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RealField.to_rational">
<span class="sig-name descname"><span class="pre">to_rational</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">limit</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/realfield.py#L106-L108"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RealField.to_rational" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a real number to rational number.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.RealField.to_sympy">
<span class="sig-name descname"><span class="pre">to_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/realfield.py#L62-L64"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.RealField.to_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">element</span></code> to SymPy number.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.mpelements.RealElement">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.mpelements.</span></span><span class="sig-name descname"><span class="pre">RealElement</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">val</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">(0,</span> <span class="pre">0,</span> <span class="pre">0,</span> <span class="pre">0)</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/mpelements.py#L14-L26"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.mpelements.RealElement" title="Permalink to this definition">¶</a></dt>
<dd><p>An element of a real domain.</p>
</dd></dl>

</section>
<section id="cc">
<span id="id9"></span><h2>CC<a class="headerlink" href="#cc" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.ComplexField">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.</span></span><span class="sig-name descname"><span class="pre">ComplexField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">prec</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">53</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dps</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tol</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/complexfield.py#L12-L148"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ComplexField" title="Permalink to this definition">¶</a></dt>
<dd><p>Complex numbers up to the given precision.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ComplexField.almosteq">
<span class="sig-name descname"><span class="pre">almosteq</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tolerance</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/complexfield.py#L146-L148"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ComplexField.almosteq" title="Permalink to this definition">¶</a></dt>
<dd><p>Check if <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code> are almost equal.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ComplexField.from_sympy">
<span class="sig-name descname"><span class="pre">from_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">expr</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/complexfield.py#L65-L73"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ComplexField.from_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert SymPy’s number to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ComplexField.gcd">
<span class="sig-name descname"><span class="pre">gcd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/complexfield.py#L138-L140"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ComplexField.gcd" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns GCD of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ComplexField.get_exact">
<span class="sig-name descname"><span class="pre">get_exact</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/complexfield.py#L118-L120"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ComplexField.get_exact" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an exact domain associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ComplexField.get_ring">
<span class="sig-name descname"><span class="pre">get_ring</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/complexfield.py#L114-L116"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ComplexField.get_ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a ring associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ComplexField.is_negative">
<span class="sig-name descname"><span class="pre">is_negative</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/complexfield.py#L122-L124"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ComplexField.is_negative" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">False</span></code> for any <code class="docutils literal notranslate"><span class="pre">ComplexElement</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ComplexField.is_nonnegative">
<span class="sig-name descname"><span class="pre">is_nonnegative</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/complexfield.py#L130-L132"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ComplexField.is_nonnegative" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">False</span></code> for any <code class="docutils literal notranslate"><span class="pre">ComplexElement</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ComplexField.is_nonpositive">
<span class="sig-name descname"><span class="pre">is_nonpositive</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/complexfield.py#L134-L136"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ComplexField.is_nonpositive" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">False</span></code> for any <code class="docutils literal notranslate"><span class="pre">ComplexElement</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ComplexField.is_positive">
<span class="sig-name descname"><span class="pre">is_positive</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/complexfield.py#L126-L128"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ComplexField.is_positive" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">False</span></code> for any <code class="docutils literal notranslate"><span class="pre">ComplexElement</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ComplexField.lcm">
<span class="sig-name descname"><span class="pre">lcm</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/complexfield.py#L142-L144"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ComplexField.lcm" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns LCM of <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ComplexField.to_sympy">
<span class="sig-name descname"><span class="pre">to_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/complexfield.py#L61-L63"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ComplexField.to_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">element</span></code> to SymPy number.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.mpelements.ComplexElement">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.mpelements.</span></span><span class="sig-name descname"><span class="pre">ComplexElement</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">real</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">imag</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/mpelements.py#L28-L40"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.mpelements.ComplexElement" title="Permalink to this definition">¶</a></dt>
<dd><p>An element of a complex domain.</p>
</dd></dl>

</section>
<section id="k-x">
<span id="id10"></span><h2>K[x]<a class="headerlink" href="#k-x" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.</span></span><span class="sig-name descname"><span class="pre">PolynomialRing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">domain_or_ring</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">symbols</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L10-L199"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing" title="Permalink to this definition">¶</a></dt>
<dd><p>A class for representing multivariate polynomial rings.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.factorial">
<span class="sig-name descname"><span class="pre">factorial</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L197-L199"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.factorial" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns factorial of <span class="math notranslate nohighlight">\(a\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.from_AlgebraicField">
<span class="sig-name descname"><span class="pre">from_AlgebraicField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L129-L134"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.from_AlgebraicField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert an algebraic number to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.from_ComplexField">
<span class="sig-name descname"><span class="pre">from_ComplexField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L125-L127"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.from_ComplexField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a mpmath <span class="math notranslate nohighlight">\(mpf\)</span> object to <span class="math notranslate nohighlight">\(dtype\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.from_FractionField">
<span class="sig-name descname"><span class="pre">from_FractionField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L143-L153"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.from_FractionField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a rational function to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.from_GaussianIntegerRing">
<span class="sig-name descname"><span class="pre">from_GaussianIntegerRing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L113-L115"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.from_GaussianIntegerRing" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a <span class="math notranslate nohighlight">\(GaussianInteger\)</span> object to <span class="math notranslate nohighlight">\(dtype\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.from_GaussianRationalField">
<span class="sig-name descname"><span class="pre">from_GaussianRationalField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L117-L119"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.from_GaussianRationalField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a <span class="math notranslate nohighlight">\(GaussianRational\)</span> object to <span class="math notranslate nohighlight">\(dtype\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.from_GlobalPolynomialRing">
<span class="sig-name descname"><span class="pre">from_GlobalPolynomialRing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L155-L163"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.from_GlobalPolynomialRing" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert from old poly ring to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.from_PolynomialRing">
<span class="sig-name descname"><span class="pre">from_PolynomialRing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L136-L141"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.from_PolynomialRing" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a polynomial to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.from_QQ">
<span class="sig-name descname"><span class="pre">from_QQ</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L97-L99"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.from_QQ" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <span class="math notranslate nohighlight">\(Fraction\)</span> object to <span class="math notranslate nohighlight">\(dtype\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.from_QQ_gmpy">
<span class="sig-name descname"><span class="pre">from_QQ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L109-L111"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.from_QQ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a GMPY <span class="math notranslate nohighlight">\(mpq\)</span> object to <span class="math notranslate nohighlight">\(dtype\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.from_QQ_python">
<span class="sig-name descname"><span class="pre">from_QQ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L101-L103"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.from_QQ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <span class="math notranslate nohighlight">\(Fraction\)</span> object to <span class="math notranslate nohighlight">\(dtype\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.from_RealField">
<span class="sig-name descname"><span class="pre">from_RealField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L121-L123"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.from_RealField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a mpmath <span class="math notranslate nohighlight">\(mpf\)</span> object to <span class="math notranslate nohighlight">\(dtype\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.from_ZZ">
<span class="sig-name descname"><span class="pre">from_ZZ</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L89-L91"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.from_ZZ" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <span class="math notranslate nohighlight">\(int\)</span> object to <span class="math notranslate nohighlight">\(dtype\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.from_ZZ_gmpy">
<span class="sig-name descname"><span class="pre">from_ZZ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L105-L107"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.from_ZZ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a GMPY <span class="math notranslate nohighlight">\(mpz\)</span> object to <span class="math notranslate nohighlight">\(dtype\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.from_ZZ_python">
<span class="sig-name descname"><span class="pre">from_ZZ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L93-L95"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.from_ZZ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <span class="math notranslate nohighlight">\(int\)</span> object to <span class="math notranslate nohighlight">\(dtype\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.from_sympy">
<span class="sig-name descname"><span class="pre">from_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L85-L87"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.from_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert SymPy’s expression to <span class="math notranslate nohighlight">\(dtype\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.gcd">
<span class="sig-name descname"><span class="pre">gcd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L189-L191"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.gcd" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns GCD of <span class="math notranslate nohighlight">\(a\)</span> and <span class="math notranslate nohighlight">\(b\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.gcdex">
<span class="sig-name descname"><span class="pre">gcdex</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L185-L187"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.gcdex" title="Permalink to this definition">¶</a></dt>
<dd><p>Extended GCD of <span class="math notranslate nohighlight">\(a\)</span> and <span class="math notranslate nohighlight">\(b\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.get_field">
<span class="sig-name descname"><span class="pre">get_field</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L165-L167"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.get_field" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a field associated with <span class="math notranslate nohighlight">\(self\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.is_negative">
<span class="sig-name descname"><span class="pre">is_negative</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L173-L175"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.is_negative" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <span class="math notranslate nohighlight">\(LC(a)\)</span> is negative.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.is_nonnegative">
<span class="sig-name descname"><span class="pre">is_nonnegative</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L181-L183"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.is_nonnegative" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <span class="math notranslate nohighlight">\(LC(a)\)</span> is non-negative.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.is_nonpositive">
<span class="sig-name descname"><span class="pre">is_nonpositive</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L177-L179"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.is_nonpositive" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <span class="math notranslate nohighlight">\(LC(a)\)</span> is non-positive.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.is_positive">
<span class="sig-name descname"><span class="pre">is_positive</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L169-L171"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.is_positive" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <span class="math notranslate nohighlight">\(LC(a)\)</span> is positive.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.is_unit">
<span class="sig-name descname"><span class="pre">is_unit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L70-L75"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.is_unit" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">True</span></code> if <code class="docutils literal notranslate"><span class="pre">a</span></code> is a unit of <code class="docutils literal notranslate"><span class="pre">self</span></code></p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.lcm">
<span class="sig-name descname"><span class="pre">lcm</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L193-L195"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.lcm" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns LCM of <span class="math notranslate nohighlight">\(a\)</span> and <span class="math notranslate nohighlight">\(b\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.PolynomialRing.to_sympy">
<span class="sig-name descname"><span class="pre">to_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L81-L83"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.PolynomialRing.to_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <span class="math notranslate nohighlight">\(a\)</span> to a SymPy object.</p>
</dd></dl>

</dd></dl>

</section>
<section id="id11">
<span id="id12"></span><h2>K(x)<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.</span></span><span class="sig-name descname"><span class="pre">FractionField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">domain_or_field</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">symbols</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L9-L184"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField" title="Permalink to this definition">¶</a></dt>
<dd><p>A class for representing multivariate rational function fields.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.denom">
<span class="sig-name descname"><span class="pre">denom</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L178-L180"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.denom" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns denominator of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.factorial">
<span class="sig-name descname"><span class="pre">factorial</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L182-L184"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.factorial" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns factorial of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.from_AlgebraicField">
<span class="sig-name descname"><span class="pre">from_AlgebraicField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L124-L129"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.from_AlgebraicField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert an algebraic number to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.from_ComplexField">
<span class="sig-name descname"><span class="pre">from_ComplexField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L120-L122"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.from_ComplexField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a mpmath <code class="docutils literal notranslate"><span class="pre">mpf</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.from_FractionField">
<span class="sig-name descname"><span class="pre">from_FractionField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L147-L152"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.from_FractionField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a rational function to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.from_GaussianIntegerRing">
<span class="sig-name descname"><span class="pre">from_GaussianIntegerRing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L112-L114"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.from_GaussianIntegerRing" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a <code class="docutils literal notranslate"><span class="pre">GaussianInteger</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.from_GaussianRationalField">
<span class="sig-name descname"><span class="pre">from_GaussianRationalField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L108-L110"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.from_GaussianRationalField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a <code class="docutils literal notranslate"><span class="pre">GaussianRational</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.from_PolynomialRing">
<span class="sig-name descname"><span class="pre">from_PolynomialRing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L131-L145"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.from_PolynomialRing" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a polynomial to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.from_QQ">
<span class="sig-name descname"><span class="pre">from_QQ</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L87-L94"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.from_QQ" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">Fraction</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.from_QQ_gmpy">
<span class="sig-name descname"><span class="pre">from_QQ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L104-L106"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.from_QQ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a GMPY <code class="docutils literal notranslate"><span class="pre">mpq</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.from_QQ_python">
<span class="sig-name descname"><span class="pre">from_QQ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L96-L98"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.from_QQ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">Fraction</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.from_RealField">
<span class="sig-name descname"><span class="pre">from_RealField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L116-L118"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.from_RealField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a mpmath <code class="docutils literal notranslate"><span class="pre">mpf</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.from_ZZ">
<span class="sig-name descname"><span class="pre">from_ZZ</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L79-L81"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.from_ZZ" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">int</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.from_ZZ_gmpy">
<span class="sig-name descname"><span class="pre">from_ZZ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L100-L102"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.from_ZZ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a GMPY <code class="docutils literal notranslate"><span class="pre">mpz</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.from_ZZ_python">
<span class="sig-name descname"><span class="pre">from_ZZ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L83-L85"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.from_ZZ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">int</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.from_sympy">
<span class="sig-name descname"><span class="pre">from_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L75-L77"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.from_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert SymPy’s expression to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.get_ring">
<span class="sig-name descname"><span class="pre">get_ring</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L154-L156"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.get_ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a field associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.is_negative">
<span class="sig-name descname"><span class="pre">is_negative</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L162-L164"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.is_negative" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">LC(a)</span></code> is negative.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.is_nonnegative">
<span class="sig-name descname"><span class="pre">is_nonnegative</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L170-L172"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.is_nonnegative" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">LC(a)</span></code> is non-negative.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.is_nonpositive">
<span class="sig-name descname"><span class="pre">is_nonpositive</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L166-L168"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.is_nonpositive" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">LC(a)</span></code> is non-positive.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.is_positive">
<span class="sig-name descname"><span class="pre">is_positive</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L158-L160"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.is_positive" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">LC(a)</span></code> is positive.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.numer">
<span class="sig-name descname"><span class="pre">numer</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L174-L176"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.numer" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns numerator of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.FractionField.to_sympy">
<span class="sig-name descname"><span class="pre">to_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/fractionfield.py#L71-L73"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.FractionField.to_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">a</span></code> to a SymPy object.</p>
</dd></dl>

</dd></dl>

</section>
<section id="ex">
<span id="id13"></span><h2>EX<a class="headerlink" href="#ex" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.</span></span><span class="sig-name descname"><span class="pre">ExpressionDomain</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L14-L251"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain" title="Permalink to this definition">¶</a></dt>
<dd><p>A class for arbitrary expressions.</p>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.Expression">
<em class="property"><span class="pre">class</span> </em><span class="sig-name descname"><span class="pre">Expression</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ex</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L20-L144"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.Expression" title="Permalink to this definition">¶</a></dt>
<dd><p>An arbitrary expression.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.denom">
<span class="sig-name descname"><span class="pre">denom</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L243-L245"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.denom" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns denominator of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.dtype">
<span class="sig-name descname"><span class="pre">dtype</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L20-L144"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.dtype" title="Permalink to this definition">¶</a></dt>
<dd><p>alias of <a class="reference internal" href="#sympy.polys.domains.expressiondomain.ExpressionDomain.Expression" title="sympy.polys.domains.expressiondomain.ExpressionDomain.Expression"><code class="xref py py-class docutils literal notranslate"><span class="pre">sympy.polys.domains.expressiondomain.ExpressionDomain.Expression</span></code></a></p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.from_ExpressionDomain">
<span class="sig-name descname"><span class="pre">from_ExpressionDomain</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L211-L213"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.from_ExpressionDomain" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a <code class="docutils literal notranslate"><span class="pre">EX</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.from_FractionField">
<span class="sig-name descname"><span class="pre">from_FractionField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L207-L209"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.from_FractionField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a <code class="docutils literal notranslate"><span class="pre">DMF</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.from_GaussianIntegerRing">
<span class="sig-name descname"><span class="pre">from_GaussianIntegerRing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L191-L193"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.from_GaussianIntegerRing" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a <code class="docutils literal notranslate"><span class="pre">GaussianRational</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.from_GaussianRationalField">
<span class="sig-name descname"><span class="pre">from_GaussianRationalField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L195-L197"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.from_GaussianRationalField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a <code class="docutils literal notranslate"><span class="pre">GaussianRational</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.from_PolynomialRing">
<span class="sig-name descname"><span class="pre">from_PolynomialRing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L203-L205"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.from_PolynomialRing" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a <code class="docutils literal notranslate"><span class="pre">DMP</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.from_QQ">
<span class="sig-name descname"><span class="pre">from_QQ</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L175-L177"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.from_QQ" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">Fraction</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.from_QQ_gmpy">
<span class="sig-name descname"><span class="pre">from_QQ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L187-L189"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.from_QQ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a GMPY <code class="docutils literal notranslate"><span class="pre">mpq</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.from_QQ_python">
<span class="sig-name descname"><span class="pre">from_QQ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L179-L181"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.from_QQ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">Fraction</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.from_RealField">
<span class="sig-name descname"><span class="pre">from_RealField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L199-L201"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.from_RealField" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a mpmath <code class="docutils literal notranslate"><span class="pre">mpf</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.from_ZZ">
<span class="sig-name descname"><span class="pre">from_ZZ</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L167-L169"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.from_ZZ" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">int</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.from_ZZ_gmpy">
<span class="sig-name descname"><span class="pre">from_ZZ_gmpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L183-L185"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.from_ZZ_gmpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a GMPY <code class="docutils literal notranslate"><span class="pre">mpz</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.from_ZZ_python">
<span class="sig-name descname"><span class="pre">from_ZZ_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">K0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L171-L173"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.from_ZZ_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a Python <code class="docutils literal notranslate"><span class="pre">int</span></code> object to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.from_sympy">
<span class="sig-name descname"><span class="pre">from_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L163-L165"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.from_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert SymPy’s expression to <code class="docutils literal notranslate"><span class="pre">dtype</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.get_field">
<span class="sig-name descname"><span class="pre">get_field</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L219-L221"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.get_field" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a field associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.get_ring">
<span class="sig-name descname"><span class="pre">get_ring</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L215-L217"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.get_ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a ring associated with <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.is_negative">
<span class="sig-name descname"><span class="pre">is_negative</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L227-L229"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.is_negative" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">a</span></code> is negative.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.is_nonnegative">
<span class="sig-name descname"><span class="pre">is_nonnegative</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L235-L237"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.is_nonnegative" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">a</span></code> is non-negative.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.is_nonpositive">
<span class="sig-name descname"><span class="pre">is_nonpositive</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L231-L233"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.is_nonpositive" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">a</span></code> is non-positive.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.is_positive">
<span class="sig-name descname"><span class="pre">is_positive</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L223-L225"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.is_positive" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">a</span></code> is positive.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.numer">
<span class="sig-name descname"><span class="pre">numer</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L239-L241"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.numer" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns numerator of <code class="docutils literal notranslate"><span class="pre">a</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.domains.ExpressionDomain.to_sympy">
<span class="sig-name descname"><span class="pre">to_sympy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L159-L161"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.ExpressionDomain.to_sympy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">a</span></code> to a SymPy object.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.expressiondomain.ExpressionDomain.Expression">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">ExpressionDomain.</span></span><span class="sig-name descname"><span class="pre">Expression</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ex</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/expressiondomain.py#L20-L144"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.expressiondomain.ExpressionDomain.Expression" title="Permalink to this definition">¶</a></dt>
<dd><p>An arbitrary expression.</p>
</dd></dl>

</section>
<section id="quotient-ring">
<h2>Quotient ring<a class="headerlink" href="#quotient-ring" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.domains.quotientring.QuotientRing">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.quotientring.</span></span><span class="sig-name descname"><span class="pre">QuotientRing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ring</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ideal</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/quotientring.py#L92-L201"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.domains.quotientring.QuotientRing" title="Permalink to this definition">¶</a></dt>
<dd><p>Class representing (commutative) quotient rings.</p>
<p>You should not usually instantiate this by hand, instead use the constructor
from the base ring in the construction.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">I</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">3</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">quotient_ring</span><span class="p">(</span><span class="n">I</span><span class="p">)</span>
<span class="go">QQ[x]/&lt;x**3 + 1&gt;</span>
</pre></div>
</div>
<p>Shorter versions are possible:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">/</span><span class="n">I</span>
<span class="go">QQ[x]/&lt;x**3 + 1&gt;</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">/</span><span class="p">[</span><span class="n">x</span><span class="o">**</span><span class="mi">3</span> <span class="o">+</span> <span class="mi">1</span><span class="p">]</span>
<span class="go">QQ[x]/&lt;x**3 + 1&gt;</span>
</pre></div>
</div>
<p>Attributes:</p>
<ul class="simple">
<li><p>ring - the base ring</p></li>
<li><p>base_ideal - the ideal used to form the quotient</p></li>
</ul>
</dd></dl>

</section>
<section id="sparse-polynomials">
<h2>Sparse polynomials<a class="headerlink" href="#sparse-polynomials" title="Permalink to this headline">¶</a></h2>
<p>Sparse polynomials are represented as dictionaries.</p>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.polys.rings.ring">
<span class="sig-prename descclassname"><span class="pre">sympy.polys.rings.</span></span><span class="sig-name descname"><span class="pre">ring</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">symbols</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domain</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">LexOrder()</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L35-L64"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a polynomial ring returning <code class="docutils literal notranslate"><span class="pre">(ring,</span> <span class="pre">x_1,</span> <span class="pre">...,</span> <span class="pre">x_n)</span></code>.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>symbols</strong> : str</p>
<blockquote>
<div><p>Symbol/Expr or sequence of str, Symbol/Expr (non-empty)</p>
</div></blockquote>
<p><strong>domain</strong> : <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> or coercible</p>
<p><strong>order</strong> : <a class="reference internal" href="reference.html#sympy.polys.orderings.MonomialOrder" title="sympy.polys.orderings.MonomialOrder"><code class="xref py py-class docutils literal notranslate"><span class="pre">MonomialOrder</span></code></a> or coercible, optional, defaults to <code class="docutils literal notranslate"><span class="pre">lex</span></code></p>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.rings</span> <span class="kn">import</span> <span class="n">ring</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.orderings</span> <span class="kn">import</span> <span class="n">lex</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">R</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span> <span class="o">=</span> <span class="n">ring</span><span class="p">(</span><span class="s2">&quot;x,y,z&quot;</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">,</span> <span class="n">lex</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span>
<span class="go">Polynomial ring in x, y, z over ZZ with lex order</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">+</span> <span class="n">y</span> <span class="o">+</span> <span class="n">z</span>
<span class="go">x + y + z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="n">_</span><span class="p">)</span>
<span class="go">&lt;class &#39;sympy.polys.rings.PolyElement&#39;&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.polys.rings.xring">
<span class="sig-prename descclassname"><span class="pre">sympy.polys.rings.</span></span><span class="sig-name descname"><span class="pre">xring</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">symbols</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domain</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">LexOrder()</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L66-L95"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.xring" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a polynomial ring returning <code class="docutils literal notranslate"><span class="pre">(ring,</span> <span class="pre">(x_1,</span> <span class="pre">...,</span> <span class="pre">x_n))</span></code>.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>symbols</strong> : str</p>
<blockquote>
<div><p>Symbol/Expr or sequence of str, Symbol/Expr (non-empty)</p>
</div></blockquote>
<p><strong>domain</strong> : <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> or coercible</p>
<p><strong>order</strong> : <a class="reference internal" href="reference.html#sympy.polys.orderings.MonomialOrder" title="sympy.polys.orderings.MonomialOrder"><code class="xref py py-class docutils literal notranslate"><span class="pre">MonomialOrder</span></code></a> or coercible, optional, defaults to <code class="docutils literal notranslate"><span class="pre">lex</span></code></p>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.rings</span> <span class="kn">import</span> <span class="n">xring</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.orderings</span> <span class="kn">import</span> <span class="n">lex</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">R</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span> <span class="o">=</span> <span class="n">xring</span><span class="p">(</span><span class="s2">&quot;x,y,z&quot;</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">,</span> <span class="n">lex</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span>
<span class="go">Polynomial ring in x, y, z over ZZ with lex order</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">+</span> <span class="n">y</span> <span class="o">+</span> <span class="n">z</span>
<span class="go">x + y + z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="n">_</span><span class="p">)</span>
<span class="go">&lt;class &#39;sympy.polys.rings.PolyElement&#39;&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.polys.rings.vring">
<span class="sig-prename descclassname"><span class="pre">sympy.polys.rings.</span></span><span class="sig-name descname"><span class="pre">vring</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">symbols</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domain</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">LexOrder()</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L97-L126"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.vring" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a polynomial ring and inject <code class="docutils literal notranslate"><span class="pre">x_1,</span> <span class="pre">...,</span> <span class="pre">x_n</span></code> into the global namespace.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>symbols</strong> : str</p>
<blockquote>
<div><p>Symbol/Expr or sequence of str, Symbol/Expr (non-empty)</p>
</div></blockquote>
<p><strong>domain</strong> : <a class="reference internal" href="#sympy.polys.domains.domain.Domain" title="sympy.polys.domains.domain.Domain"><code class="xref py py-class docutils literal notranslate"><span class="pre">Domain</span></code></a> or coercible</p>
<p><strong>order</strong> : <a class="reference internal" href="reference.html#sympy.polys.orderings.MonomialOrder" title="sympy.polys.orderings.MonomialOrder"><code class="xref py py-class docutils literal notranslate"><span class="pre">MonomialOrder</span></code></a> or coercible, optional, defaults to <code class="docutils literal notranslate"><span class="pre">lex</span></code></p>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.rings</span> <span class="kn">import</span> <span class="n">vring</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.orderings</span> <span class="kn">import</span> <span class="n">lex</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">vring</span><span class="p">(</span><span class="s2">&quot;x,y,z&quot;</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">,</span> <span class="n">lex</span><span class="p">)</span>
<span class="go">Polynomial ring in x, y, z over ZZ with lex order</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">+</span> <span class="n">y</span> <span class="o">+</span> <span class="n">z</span> <span class="c1"># noqa:</span>
<span class="go">x + y + z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="n">_</span><span class="p">)</span>
<span class="go">&lt;class &#39;sympy.polys.rings.PolyElement&#39;&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.polys.rings.sring">
<span class="sig-prename descclassname"><span class="pre">sympy.polys.rings.</span></span><span class="sig-name descname"><span class="pre">sring</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">exprs</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">symbols</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">options</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L128-L180"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.sring" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a ring deriving generators and domain from options and input expressions.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>exprs</strong> : <a class="reference internal" href="../core.html#sympy.core.expr.Expr" title="sympy.core.expr.Expr"><code class="xref py py-class docutils literal notranslate"><span class="pre">Expr</span></code></a> or sequence of <a class="reference internal" href="../core.html#sympy.core.expr.Expr" title="sympy.core.expr.Expr"><code class="xref py py-class docutils literal notranslate"><span class="pre">Expr</span></code></a> (sympifiable)</p>
<p><strong>symbols</strong> : sequence of <a class="reference internal" href="../core.html#sympy.core.symbol.Symbol" title="sympy.core.symbol.Symbol"><code class="xref py py-class docutils literal notranslate"><span class="pre">Symbol</span></code></a>/<a class="reference internal" href="../core.html#sympy.core.expr.Expr" title="sympy.core.expr.Expr"><code class="xref py py-class docutils literal notranslate"><span class="pre">Expr</span></code></a></p>
<p><strong>options</strong> : keyword arguments understood by <a class="reference internal" href="internals.html#sympy.polys.polyoptions.Options" title="sympy.polys.polyoptions.Options"><code class="xref py py-class docutils literal notranslate"><span class="pre">Options</span></code></a></p>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.core</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.rings</span> <span class="kn">import</span> <span class="n">sring</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s2">&quot;x,y,z&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span><span class="p">,</span> <span class="n">f</span> <span class="o">=</span> <span class="n">sring</span><span class="p">(</span><span class="n">x</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">y</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">z</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span>
<span class="go">Polynomial ring in x, y, z over ZZ with lex order</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f</span>
<span class="go">x + 2*y + 3*z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="n">_</span><span class="p">)</span>
<span class="go">&lt;class &#39;sympy.polys.rings.PolyElement&#39;&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyRing">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.rings.</span></span><span class="sig-name descname"><span class="pre">PolyRing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">symbols</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domain</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">LexOrder()</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L197-L554"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyRing" title="Permalink to this definition">¶</a></dt>
<dd><p>Multivariate distributed polynomial ring.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyRing.add">
<span class="sig-name descname"><span class="pre">add</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">objs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L475-L500"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyRing.add" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a sequence of polynomials or containers of polynomials.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.rings</span> <span class="kn">import</span> <span class="n">ring</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">R</span><span class="p">,</span> <span class="n">x</span> <span class="o">=</span> <span class="n">ring</span><span class="p">(</span><span class="s2">&quot;x&quot;</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span><span class="o">.</span><span class="n">add</span><span class="p">([</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">i</span> <span class="o">+</span> <span class="mi">3</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span> <span class="p">])</span>
<span class="go">4*x**2 + 24</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">_</span><span class="o">.</span><span class="n">factor_list</span><span class="p">()</span>
<span class="go">(4, [(x**2 + 6, 1)])</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyRing.add_gens">
<span class="sig-name descname"><span class="pre">add_gens</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">symbols</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L551-L554"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyRing.add_gens" title="Permalink to this definition">¶</a></dt>
<dd><p>Add the elements of <code class="docutils literal notranslate"><span class="pre">symbols</span></code> as generators to <code class="docutils literal notranslate"><span class="pre">self</span></code></p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyRing.compose">
<span class="sig-name descname"><span class="pre">compose</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L543-L549"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyRing.compose" title="Permalink to this definition">¶</a></dt>
<dd><p>Add the generators of <code class="docutils literal notranslate"><span class="pre">other</span></code> to <code class="docutils literal notranslate"><span class="pre">self</span></code></p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyRing.drop">
<span class="sig-name descname"><span class="pre">drop</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">gens</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L435-L443"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyRing.drop" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove specified generators from this ring.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyRing.drop_to_ground">
<span class="sig-name descname"><span class="pre">drop_to_ground</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">gens</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L529-L541"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyRing.drop_to_ground" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove specified generators from the ring and inject them into
its domain.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyRing.index">
<span class="sig-name descname"><span class="pre">index</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">gen</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L404-L433"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyRing.index" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute index of <code class="docutils literal notranslate"><span class="pre">gen</span></code> in <code class="docutils literal notranslate"><span class="pre">self.gens</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyRing.monomial_basis">
<span class="sig-name descname"><span class="pre">monomial_basis</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">i</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L303-L307"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyRing.monomial_basis" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the ith-basis element.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyRing.mul">
<span class="sig-name descname"><span class="pre">mul</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">objs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L502-L527"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyRing.mul" title="Permalink to this definition">¶</a></dt>
<dd><p>Multiply a sequence of polynomials or containers of polynomials.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.rings</span> <span class="kn">import</span> <span class="n">ring</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">R</span><span class="p">,</span> <span class="n">x</span> <span class="o">=</span> <span class="n">ring</span><span class="p">(</span><span class="s2">&quot;x&quot;</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span><span class="o">.</span><span class="n">mul</span><span class="p">([</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">i</span> <span class="o">+</span> <span class="mi">3</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span> <span class="p">])</span>
<span class="go">x**8 + 24*x**6 + 206*x**4 + 744*x**2 + 945</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">_</span><span class="o">.</span><span class="n">factor_list</span><span class="p">()</span>
<span class="go">(1, [(x**2 + 3, 1), (x**2 + 5, 1), (x**2 + 7, 1), (x**2 + 9, 1)])</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.rings.</span></span><span class="sig-name descname"><span class="pre">PolyElement</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L557-L2468"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement" title="Permalink to this definition">¶</a></dt>
<dd><p>Element of multivariate distributed polynomial ring.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.almosteq">
<span class="sig-name descname"><span class="pre">almosteq</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tolerance</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L683-L705"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.almosteq" title="Permalink to this definition">¶</a></dt>
<dd><p>Approximate equality test for polynomials.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.cancel">
<span class="sig-name descname"><span class="pre">cancel</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L2201-L2255"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.cancel" title="Permalink to this definition">¶</a></dt>
<dd><p>Cancel common factors in a rational function <code class="docutils literal notranslate"><span class="pre">f/g</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys</span> <span class="kn">import</span> <span class="n">ring</span><span class="p">,</span> <span class="n">ZZ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span><span class="n">y</span> <span class="o">=</span> <span class="n">ring</span><span class="p">(</span><span class="s2">&quot;x,y&quot;</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">cancel</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">2</span><span class="o">*</span><span class="n">x</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">(2*x + 2, x - 1)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.coeff">
<span class="sig-name descname"><span class="pre">coeff</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1688-L1723"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.coeff" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the coefficient that stands next to the given monomial.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>element</strong> : PolyElement (with <code class="docutils literal notranslate"><span class="pre">is_monomial</span> <span class="pre">=</span> <span class="pre">True</span></code>) or 1</p>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.rings</span> <span class="kn">import</span> <span class="n">ring</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">_</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span> <span class="o">=</span> <span class="n">ring</span><span class="p">(</span><span class="s2">&quot;x,y,z&quot;</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f</span> <span class="o">=</span> <span class="mi">3</span><span class="o">*</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">*</span><span class="n">y</span> <span class="o">-</span> <span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="o">*</span><span class="n">z</span> <span class="o">+</span> <span class="mi">7</span><span class="o">*</span><span class="n">z</span><span class="o">**</span><span class="mi">3</span> <span class="o">+</span> <span class="mi">23</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="o">.</span><span class="n">coeff</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">*</span><span class="n">y</span><span class="p">)</span>
<span class="go">3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="o">.</span><span class="n">coeff</span><span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="o">.</span><span class="n">coeff</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">23</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.coeffs">
<span class="sig-name descname"><span class="pre">coeffs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1801-L1825"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.coeffs" title="Permalink to this definition">¶</a></dt>
<dd><p>Ordered list of polynomial coefficients.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>order</strong> : <a class="reference internal" href="reference.html#sympy.polys.orderings.MonomialOrder" title="sympy.polys.orderings.MonomialOrder"><code class="xref py py-class docutils literal notranslate"><span class="pre">MonomialOrder</span></code></a> or coercible, optional</p>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.rings</span> <span class="kn">import</span> <span class="n">ring</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.orderings</span> <span class="kn">import</span> <span class="n">lex</span><span class="p">,</span> <span class="n">grlex</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">_</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">ring</span><span class="p">(</span><span class="s2">&quot;x, y&quot;</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">,</span> <span class="n">lex</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f</span> <span class="o">=</span> <span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="o">**</span><span class="mi">7</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">*</span><span class="n">y</span><span class="o">**</span><span class="mi">3</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="o">.</span><span class="n">coeffs</span><span class="p">()</span>
<span class="go">[2, 1]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="o">.</span><span class="n">coeffs</span><span class="p">(</span><span class="n">grlex</span><span class="p">)</span>
<span class="go">[1, 2]</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.const">
<span class="sig-name descname"><span class="pre">const</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1725-L1727"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.const" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the constant coeffcient.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.content">
<span class="sig-name descname"><span class="pre">content</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1938-L1947"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.content" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns GCD of polynomial’s coefficients.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.copy">
<span class="sig-name descname"><span class="pre">copy</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L582-L608"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.copy" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a copy of polynomial self.</p>
<p>Polynomials are mutable; if one is interested in preserving
a polynomial, and one plans to use inplace operations, one
can copy the polynomial. This method makes a shallow copy.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.rings</span> <span class="kn">import</span> <span class="n">ring</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">R</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">ring</span><span class="p">(</span><span class="s1">&#39;x, y&#39;</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="p">(</span><span class="n">x</span> <span class="o">+</span> <span class="n">y</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p1</span> <span class="o">=</span> <span class="n">p</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p2</span> <span class="o">=</span> <span class="n">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="p">[</span><span class="n">R</span><span class="o">.</span><span class="n">zero_monom</span><span class="p">]</span> <span class="o">=</span> <span class="mi">3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span>
<span class="go">x**2 + 2*x*y + y**2 + 3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p1</span>
<span class="go">x**2 + 2*x*y + y**2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p2</span>
<span class="go">x**2 + 2*x*y + y**2 + 3</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.degree">
<span class="sig-name descname"><span class="pre">degree</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1609-L1623"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.degree" title="Permalink to this definition">¶</a></dt>
<dd><p>The leading degree in <code class="docutils literal notranslate"><span class="pre">x</span></code> or the main variable.</p>
<p>Note that the degree of 0 is negative infinity (the SymPy object -oo).</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.degrees">
<span class="sig-name descname"><span class="pre">degrees</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1625-L1635"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.degrees" title="Permalink to this definition">¶</a></dt>
<dd><p>A tuple containing leading degrees in all variables.</p>
<p>Note that the degree of 0 is negative infinity (the SymPy object -oo)</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.diff">
<span class="sig-name descname"><span class="pre">diff</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L2261-L2284"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.diff" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes partial derivative in <code class="docutils literal notranslate"><span class="pre">x</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.rings</span> <span class="kn">import</span> <span class="n">ring</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">_</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">ring</span><span class="p">(</span><span class="s2">&quot;x,y&quot;</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">x</span> <span class="o">+</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">*</span><span class="n">y</span><span class="o">**</span><span class="mi">3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2*x*y**3 + 1</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.div">
<span class="sig-name descname"><span class="pre">div</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fv</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1396-L1470"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.div" title="Permalink to this definition">¶</a></dt>
<dd><p>Division algorithm, see [CLO] p64.</p>
<dl class="simple">
<dt>fv array of polynomials</dt><dd><p>return qv, r such that
self = sum(fv[i]*qv[i]) + r</p>
</dd>
</dl>
<p>All polynomials are required not to be Laurent polynomials.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.rings</span> <span class="kn">import</span> <span class="n">ring</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">_</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">ring</span><span class="p">(</span><span class="s1">&#39;x, y&#39;</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f</span> <span class="o">=</span> <span class="n">x</span><span class="o">**</span><span class="mi">3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f0</span> <span class="o">=</span> <span class="n">x</span> <span class="o">-</span> <span class="n">y</span><span class="o">**</span><span class="mi">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f1</span> <span class="o">=</span> <span class="n">x</span> <span class="o">-</span> <span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">qv</span><span class="p">,</span> <span class="n">r</span> <span class="o">=</span> <span class="n">f</span><span class="o">.</span><span class="n">div</span><span class="p">((</span><span class="n">f0</span><span class="p">,</span> <span class="n">f1</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">qv</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="go">x**2 + x*y**2 + y**4</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">qv</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">r</span>
<span class="go">y**6</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.imul_num">
<span class="sig-name descname"><span class="pre">imul_num</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">c</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1903-L1936"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.imul_num" title="Permalink to this definition">¶</a></dt>
<dd><p>multiply inplace the polynomial p by an element in the
coefficient ring, provided p is not one of the generators;
else multiply not inplace</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.rings</span> <span class="kn">import</span> <span class="n">ring</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">_</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">ring</span><span class="p">(</span><span class="s1">&#39;x, y&#39;</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">x</span> <span class="o">+</span> <span class="n">y</span><span class="o">**</span><span class="mi">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p1</span> <span class="o">=</span> <span class="n">p</span><span class="o">.</span><span class="n">imul_num</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p1</span>
<span class="go">3*x + 3*y**2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p1</span> <span class="ow">is</span> <span class="n">p</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p1</span> <span class="o">=</span> <span class="n">p</span><span class="o">.</span><span class="n">imul_num</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p1</span>
<span class="go">3*x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p1</span> <span class="ow">is</span> <span class="n">p</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.itercoeffs">
<span class="sig-name descname"><span class="pre">itercoeffs</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1879-L1881"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.itercoeffs" title="Permalink to this definition">¶</a></dt>
<dd><p>Iterator over coefficients of a polynomial.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.itermonoms">
<span class="sig-name descname"><span class="pre">itermonoms</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1883-L1885"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.itermonoms" title="Permalink to this definition">¶</a></dt>
<dd><p>Iterator over monomials of a polynomial.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.iterterms">
<span class="sig-name descname"><span class="pre">iterterms</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1887-L1889"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.iterterms" title="Permalink to this definition">¶</a></dt>
<dd><p>Iterator over terms of a polynomial.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.leading_expv">
<span class="sig-name descname"><span class="pre">leading_expv</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1665-L1683"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.leading_expv" title="Permalink to this definition">¶</a></dt>
<dd><p>Leading monomial tuple according to the monomial ordering.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.rings</span> <span class="kn">import</span> <span class="n">ring</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">_</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span> <span class="o">=</span> <span class="n">ring</span><span class="p">(</span><span class="s1">&#39;x, y, z&#39;</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">x</span><span class="o">**</span><span class="mi">4</span> <span class="o">+</span> <span class="n">x</span><span class="o">**</span><span class="mi">3</span><span class="o">*</span><span class="n">y</span> <span class="o">+</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">*</span><span class="n">z</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">z</span><span class="o">**</span><span class="mi">7</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">.</span><span class="n">leading_expv</span><span class="p">()</span>
<span class="go">(4, 0, 0)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.leading_monom">
<span class="sig-name descname"><span class="pre">leading_monom</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1741-L1760"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.leading_monom" title="Permalink to this definition">¶</a></dt>
<dd><p>Leading monomial as a polynomial element.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.rings</span> <span class="kn">import</span> <span class="n">ring</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">_</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">ring</span><span class="p">(</span><span class="s1">&#39;x, y&#39;</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="p">(</span><span class="mi">3</span><span class="o">*</span><span class="n">x</span><span class="o">*</span><span class="n">y</span> <span class="o">+</span> <span class="n">y</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">leading_monom</span><span class="p">()</span>
<span class="go">x*y</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.leading_term">
<span class="sig-name descname"><span class="pre">leading_term</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1770-L1788"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.leading_term" title="Permalink to this definition">¶</a></dt>
<dd><p>Leading term as a polynomial element.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.rings</span> <span class="kn">import</span> <span class="n">ring</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">_</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">ring</span><span class="p">(</span><span class="s1">&#39;x, y&#39;</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="p">(</span><span class="mi">3</span><span class="o">*</span><span class="n">x</span><span class="o">*</span><span class="n">y</span> <span class="o">+</span> <span class="n">y</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">leading_term</span><span class="p">()</span>
<span class="go">3*x*y</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.listcoeffs">
<span class="sig-name descname"><span class="pre">listcoeffs</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1891-L1893"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.listcoeffs" title="Permalink to this definition">¶</a></dt>
<dd><p>Unordered list of polynomial coefficients.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.listmonoms">
<span class="sig-name descname"><span class="pre">listmonoms</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1895-L1897"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.listmonoms" title="Permalink to this definition">¶</a></dt>
<dd><p>Unordered list of polynomial monomials.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.listterms">
<span class="sig-name descname"><span class="pre">listterms</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1899-L1901"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.listterms" title="Permalink to this definition">¶</a></dt>
<dd><p>Unordered list of polynomial terms.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.monic">
<span class="sig-name descname"><span class="pre">monic</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1954-L1959"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.monic" title="Permalink to this definition">¶</a></dt>
<dd><p>Divides all coefficients by the leading coefficient.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.monoms">
<span class="sig-name descname"><span class="pre">monoms</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1827-L1851"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.monoms" title="Permalink to this definition">¶</a></dt>
<dd><p>Ordered list of polynomial monomials.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>order</strong> : <a class="reference internal" href="reference.html#sympy.polys.orderings.MonomialOrder" title="sympy.polys.orderings.MonomialOrder"><code class="xref py py-class docutils literal notranslate"><span class="pre">MonomialOrder</span></code></a> or coercible, optional</p>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.rings</span> <span class="kn">import</span> <span class="n">ring</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.orderings</span> <span class="kn">import</span> <span class="n">lex</span><span class="p">,</span> <span class="n">grlex</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">_</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">ring</span><span class="p">(</span><span class="s2">&quot;x, y&quot;</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">,</span> <span class="n">lex</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f</span> <span class="o">=</span> <span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="o">**</span><span class="mi">7</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">*</span><span class="n">y</span><span class="o">**</span><span class="mi">3</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="o">.</span><span class="n">monoms</span><span class="p">()</span>
<span class="go">[(2, 3), (1, 7)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="o">.</span><span class="n">monoms</span><span class="p">(</span><span class="n">grlex</span><span class="p">)</span>
<span class="go">[(1, 7), (2, 3)]</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.primitive">
<span class="sig-name descname"><span class="pre">primitive</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1949-L1952"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.primitive" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns content and a primitive polynomial.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.square">
<span class="sig-name descname"><span class="pre">square</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1244-L1278"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.square" title="Permalink to this definition">¶</a></dt>
<dd><p>square of a polynomial</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.rings</span> <span class="kn">import</span> <span class="n">ring</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">_</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">ring</span><span class="p">(</span><span class="s1">&#39;x, y&#39;</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">x</span> <span class="o">+</span> <span class="n">y</span><span class="o">**</span><span class="mi">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">.</span><span class="n">square</span><span class="p">()</span>
<span class="go">x**2 + 2*x*y**2 + y**4</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.strip_zero">
<span class="sig-name descname"><span class="pre">strip_zero</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L648-L652"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.strip_zero" title="Permalink to this definition">¶</a></dt>
<dd><p>Eliminate monomials with zero coefficient.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.tail_degree">
<span class="sig-name descname"><span class="pre">tail_degree</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1637-L1651"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.tail_degree" title="Permalink to this definition">¶</a></dt>
<dd><p>The tail degree in <code class="docutils literal notranslate"><span class="pre">x</span></code> or the main variable.</p>
<p>Note that the degree of 0 is negative infinity (the SymPy object -oo)</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.tail_degrees">
<span class="sig-name descname"><span class="pre">tail_degrees</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1653-L1663"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.tail_degrees" title="Permalink to this definition">¶</a></dt>
<dd><p>A tuple containing tail degrees in all variables.</p>
<p>Note that the degree of 0 is negative infinity (the SymPy object -oo)</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.rings.PolyElement.terms">
<span class="sig-name descname"><span class="pre">terms</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/rings.py#L1853-L1877"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.rings.PolyElement.terms" title="Permalink to this definition">¶</a></dt>
<dd><p>Ordered list of polynomial terms.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>order</strong> : <a class="reference internal" href="reference.html#sympy.polys.orderings.MonomialOrder" title="sympy.polys.orderings.MonomialOrder"><code class="xref py py-class docutils literal notranslate"><span class="pre">MonomialOrder</span></code></a> or coercible, optional</p>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.rings</span> <span class="kn">import</span> <span class="n">ring</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.orderings</span> <span class="kn">import</span> <span class="n">lex</span><span class="p">,</span> <span class="n">grlex</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">_</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">ring</span><span class="p">(</span><span class="s2">&quot;x, y&quot;</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">,</span> <span class="n">lex</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f</span> <span class="o">=</span> <span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="o">**</span><span class="mi">7</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">*</span><span class="n">y</span><span class="o">**</span><span class="mi">3</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="o">.</span><span class="n">terms</span><span class="p">()</span>
<span class="go">[((2, 3), 2), ((1, 7), 1)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="o">.</span><span class="n">terms</span><span class="p">(</span><span class="n">grlex</span><span class="p">)</span>
<span class="go">[((1, 7), 1), ((2, 3), 2)]</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

</section>
<section id="sparse-rational-functions">
<h2>Sparse rational functions<a class="headerlink" href="#sparse-rational-functions" title="Permalink to this headline">¶</a></h2>
<p>Sparse polynomials are represented as dictionaries.</p>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.polys.fields.field">
<span class="sig-prename descclassname"><span class="pre">sympy.polys.fields.</span></span><span class="sig-name descname"><span class="pre">field</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">symbols</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domain</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">LexOrder()</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/fields.py#L30-L34"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.fields.field" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct new rational function field returning (field, x1, …, xn).</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.polys.fields.xfield">
<span class="sig-prename descclassname"><span class="pre">sympy.polys.fields.</span></span><span class="sig-name descname"><span class="pre">xfield</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">symbols</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domain</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">LexOrder()</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/fields.py#L36-L40"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.fields.xfield" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct new rational function field returning (field, (x1, …, xn)).</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.polys.fields.vfield">
<span class="sig-prename descclassname"><span class="pre">sympy.polys.fields.</span></span><span class="sig-name descname"><span class="pre">vfield</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">symbols</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domain</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">LexOrder()</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/fields.py#L42-L47"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.fields.vfield" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct new rational function field and inject generators into global namespace.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.polys.fields.sfield">
<span class="sig-prename descclassname"><span class="pre">sympy.polys.fields.</span></span><span class="sig-name descname"><span class="pre">sfield</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">exprs</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">symbols</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">options</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/fields.py#L49-L100"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.fields.sfield" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a field deriving generators and domain
from options and input expressions.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>exprs</strong> : py:class:<span class="math notranslate nohighlight">\(~.Expr\)</span> or sequence of <a class="reference internal" href="../core.html#sympy.core.expr.Expr" title="sympy.core.expr.Expr"><code class="xref py py-class docutils literal notranslate"><span class="pre">Expr</span></code></a> (sympifiable)</p>
<p><strong>symbols</strong> : sequence of <a class="reference internal" href="../core.html#sympy.core.symbol.Symbol" title="sympy.core.symbol.Symbol"><code class="xref py py-class docutils literal notranslate"><span class="pre">Symbol</span></code></a>/<a class="reference internal" href="../core.html#sympy.core.expr.Expr" title="sympy.core.expr.Expr"><code class="xref py py-class docutils literal notranslate"><span class="pre">Expr</span></code></a></p>
<p><strong>options</strong> : keyword arguments understood by <a class="reference internal" href="internals.html#sympy.polys.polyoptions.Options" title="sympy.polys.polyoptions.Options"><code class="xref py py-class docutils literal notranslate"><span class="pre">Options</span></code></a></p>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.core</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions</span> <span class="kn">import</span> <span class="n">exp</span><span class="p">,</span> <span class="n">log</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.fields</span> <span class="kn">import</span> <span class="n">sfield</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s2">&quot;x&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="p">,</span> <span class="n">f</span> <span class="o">=</span> <span class="n">sfield</span><span class="p">((</span><span class="n">x</span><span class="o">*</span><span class="n">log</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">+</span> <span class="mi">4</span><span class="o">*</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span><span class="o">*</span><span class="n">exp</span><span class="p">(</span><span class="mi">1</span><span class="o">/</span><span class="n">x</span> <span class="o">+</span> <span class="n">log</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">/</span><span class="mi">3</span><span class="p">)</span><span class="o">/</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">K</span>
<span class="go">Rational function field in x, exp(1/x), log(x), x**(1/3) over ZZ with lex order</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f</span>
<span class="go">(4*x**2*(exp(1/x)) + x*(exp(1/x))*(log(x)))/((x**(1/3))**5)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.fields.FracField">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.fields.</span></span><span class="sig-name descname"><span class="pre">FracField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">symbols</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domain</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">LexOrder()</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/fields.py#L104-L282"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.fields.FracField" title="Permalink to this definition">¶</a></dt>
<dd><p>Multivariate distributed rational function field.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.fields.FracElement">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.fields.</span></span><span class="sig-name descname"><span class="pre">FracElement</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">numer</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">denom</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/fields.py#L284-L629"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.fields.FracElement" title="Permalink to this definition">¶</a></dt>
<dd><p>Element of multivariate distributed rational function field.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.fields.FracElement.diff">
<span class="sig-name descname"><span class="pre">diff</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/fields.py#L584-L599"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.fields.FracElement.diff" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes partial derivative in <code class="docutils literal notranslate"><span class="pre">x</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.fields</span> <span class="kn">import</span> <span class="n">field</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">_</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span> <span class="o">=</span> <span class="n">field</span><span class="p">(</span><span class="s2">&quot;x,y,z&quot;</span><span class="p">,</span> <span class="n">ZZ</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="p">((</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">y</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="n">z</span> <span class="o">+</span> <span class="mi">1</span><span class="p">))</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2*x/(z + 1)</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

</section>
<section id="dense-polynomials">
<h2>Dense polynomials<a class="headerlink" href="#dense-polynomials" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.polyclasses.</span></span><span class="sig-name descname"><span class="pre">DMP</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rep</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dom</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lev</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ring</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L142-L1052"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP" title="Permalink to this definition">¶</a></dt>
<dd><p>Dense Multivariate Polynomials over <span class="math notranslate nohighlight">\(K\)</span>.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.LC">
<span class="sig-name descname"><span class="pre">LC</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L561-L563"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.LC" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the leading coefficient of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.TC">
<span class="sig-name descname"><span class="pre">TC</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L565-L567"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.TC" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the trailing coefficient of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.abs">
<span class="sig-name descname"><span class="pre">abs</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L431-L433"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.abs" title="Permalink to this definition">¶</a></dt>
<dd><p>Make all coefficients in <code class="docutils literal notranslate"><span class="pre">f</span></code> positive.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.add">
<span class="sig-name descname"><span class="pre">add</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L439-L442"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.add" title="Permalink to this definition">¶</a></dt>
<dd><p>Add two multivariate polynomials <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.add_ground">
<span class="sig-name descname"><span class="pre">add_ground</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">c</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L411-L413"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.add_ground" title="Permalink to this definition">¶</a></dt>
<dd><p>Add an element of the ground domain to <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.all_coeffs">
<span class="sig-name descname"><span class="pre">all_coeffs</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L315-L323"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.all_coeffs" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns all coefficients from <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.all_monoms">
<span class="sig-name descname"><span class="pre">all_monoms</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L325-L335"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.all_monoms" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns all monomials from <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.all_terms">
<span class="sig-name descname"><span class="pre">all_terms</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L337-L347"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.all_terms" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns all terms from a <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.cancel">
<span class="sig-name descname"><span class="pre">cancel</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L687-L701"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.cancel" title="Permalink to this definition">¶</a></dt>
<dd><p>Cancel common factors in a rational function <code class="docutils literal notranslate"><span class="pre">f/g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.clear_denoms">
<span class="sig-name descname"><span class="pre">clear_denoms</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L584-L587"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.clear_denoms" title="Permalink to this definition">¶</a></dt>
<dd><p>Clear denominators, but keep the ground domain.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.coeffs">
<span class="sig-name descname"><span class="pre">coeffs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L303-L305"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.coeffs" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns all non-zero coefficients from <code class="docutils literal notranslate"><span class="pre">f</span></code> in lex order.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.cofactors">
<span class="sig-name descname"><span class="pre">cofactors</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L671-L675"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.cofactors" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns GCD of <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code> and their cofactors.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.compose">
<span class="sig-name descname"><span class="pre">compose</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L720-L723"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.compose" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes functional composition of <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.content">
<span class="sig-name descname"><span class="pre">content</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L711-L713"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.content" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns GCD of polynomial coefficients.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.convert">
<span class="sig-name descname"><span class="pre">convert</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dom</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L292-L297"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.convert" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert the ground domain of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.count_complex_roots">
<span class="sig-name descname"><span class="pre">count_complex_roots</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">inf</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sup</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L835-L837"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.count_complex_roots" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the number of complex roots of <code class="docutils literal notranslate"><span class="pre">f</span></code> in <code class="docutils literal notranslate"><span class="pre">[inf,</span> <span class="pre">sup]</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.count_real_roots">
<span class="sig-name descname"><span class="pre">count_real_roots</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">inf</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sup</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L831-L833"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.count_real_roots" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the number of real roots of <code class="docutils literal notranslate"><span class="pre">f</span></code> in <code class="docutils literal notranslate"><span class="pre">[inf,</span> <span class="pre">sup]</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.decompose">
<span class="sig-name descname"><span class="pre">decompose</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L725-L730"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.decompose" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes functional decomposition of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.deflate">
<span class="sig-name descname"><span class="pre">deflate</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L353-L356"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.deflate" title="Permalink to this definition">¶</a></dt>
<dd><p>Reduce degree of <span class="math notranslate nohighlight">\(f\)</span> by mapping <span class="math notranslate nohighlight">\(x_i^m\)</span> to <span class="math notranslate nohighlight">\(y_i\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.degree">
<span class="sig-name descname"><span class="pre">degree</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">j</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L511-L516"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.degree" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the leading degree of <code class="docutils literal notranslate"><span class="pre">f</span></code> in <code class="docutils literal notranslate"><span class="pre">x_j</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.degree_list">
<span class="sig-name descname"><span class="pre">degree_list</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L518-L520"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.degree_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of degrees of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.diff">
<span class="sig-name descname"><span class="pre">diff</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">j</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L599-L607"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.diff" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes the <code class="docutils literal notranslate"><span class="pre">m</span></code>-th order derivative of <code class="docutils literal notranslate"><span class="pre">f</span></code> in <code class="docutils literal notranslate"><span class="pre">x_j</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.discriminant">
<span class="sig-name descname"><span class="pre">discriminant</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L667-L669"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.discriminant" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes discriminant of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.div">
<span class="sig-name descname"><span class="pre">div</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L486-L490"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.div" title="Permalink to this definition">¶</a></dt>
<dd><p>Polynomial division with remainder of <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.eject">
<span class="sig-name descname"><span class="pre">eject</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dom</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">front</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L363-L366"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.eject" title="Permalink to this definition">¶</a></dt>
<dd><p>Eject selected generators into the ground domain.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.eval">
<span class="sig-name descname"><span class="pre">eval</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">j</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L609-L615"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.eval" title="Permalink to this definition">¶</a></dt>
<dd><p>Evaluates <code class="docutils literal notranslate"><span class="pre">f</span></code> at the given point <code class="docutils literal notranslate"><span class="pre">a</span></code> in <code class="docutils literal notranslate"><span class="pre">x_j</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.exclude">
<span class="sig-name descname"><span class="pre">exclude</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L368-L385"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.exclude" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove useless generators from <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
<p>Returns the removed generators and the new excluded <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.polyclasses</span> <span class="kn">import</span> <span class="n">DMP</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DMP</span><span class="p">([[[</span><span class="n">ZZ</span><span class="p">(</span><span class="mi">1</span><span class="p">)]],</span> <span class="p">[[</span><span class="n">ZZ</span><span class="p">(</span><span class="mi">1</span><span class="p">)],</span> <span class="p">[</span><span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">)]]],</span> <span class="n">ZZ</span><span class="p">)</span><span class="o">.</span><span class="n">exclude</span><span class="p">()</span>
<span class="go">([2], DMP([[1], [1, 2]], ZZ, None))</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.exquo">
<span class="sig-name descname"><span class="pre">exquo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L502-L509"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.exquo" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes polynomial exact quotient of <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.exquo_ground">
<span class="sig-name descname"><span class="pre">exquo_ground</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">c</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L427-L429"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.exquo_ground" title="Permalink to this definition">¶</a></dt>
<dd><p>Exact quotient of <code class="docutils literal notranslate"><span class="pre">f</span></code> by a an element of the ground domain.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.factor_list">
<span class="sig-name descname"><span class="pre">factor_list</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L791-L794"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.factor_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of irreducible factors of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.factor_list_include">
<span class="sig-name descname"><span class="pre">factor_list_include</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L796-L799"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.factor_list_include" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of irreducible factors of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.from_dict">
<em class="property"><span class="pre">classmethod</span> </em><span class="sig-name descname"><span class="pre">from_dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rep</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lev</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dom</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L271-L274"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.from_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct and instance of <code class="docutils literal notranslate"><span class="pre">cls</span></code> from a <code class="docutils literal notranslate"><span class="pre">dict</span></code> representation.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.from_list">
<em class="property"><span class="pre">classmethod</span> </em><span class="sig-name descname"><span class="pre">from_list</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rep</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lev</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dom</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L223-L226"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.from_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an instance of <code class="docutils literal notranslate"><span class="pre">cls</span></code> given a list of native coefficients.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.from_sympy_list">
<em class="property"><span class="pre">classmethod</span> </em><span class="sig-name descname"><span class="pre">from_sympy_list</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rep</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lev</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dom</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L228-L231"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.from_sympy_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an instance of <code class="docutils literal notranslate"><span class="pre">cls</span></code> given a list of SymPy coefficients.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.gcd">
<span class="sig-name descname"><span class="pre">gcd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L677-L680"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.gcd" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns polynomial GCD of <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.gcdex">
<span class="sig-name descname"><span class="pre">gcdex</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L627-L635"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.gcdex" title="Permalink to this definition">¶</a></dt>
<dd><p>Extended Euclidean algorithm, if univariate.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.gff_list">
<span class="sig-name descname"><span class="pre">gff_list</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L760-L765"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.gff_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes greatest factorial factorization of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.half_gcdex">
<span class="sig-name descname"><span class="pre">half_gcdex</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L617-L625"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.half_gcdex" title="Permalink to this definition">¶</a></dt>
<dd><p>Half extended Euclidean algorithm, if univariate.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.homogeneous_order">
<span class="sig-name descname"><span class="pre">homogeneous_order</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L545-L559"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.homogeneous_order" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the homogeneous order of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.homogenize">
<span class="sig-name descname"><span class="pre">homogenize</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">s</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L526-L543"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.homogenize" title="Permalink to this definition">¶</a></dt>
<dd><p>Return homogeneous polynomial of <code class="docutils literal notranslate"><span class="pre">f</span></code></p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.inject">
<span class="sig-name descname"><span class="pre">inject</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">front</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L358-L361"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.inject" title="Permalink to this definition">¶</a></dt>
<dd><p>Inject ground domain generators into <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.integrate">
<span class="sig-name descname"><span class="pre">integrate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">j</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L589-L597"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.integrate" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes the <code class="docutils literal notranslate"><span class="pre">m</span></code>-th order indefinite integral of <code class="docutils literal notranslate"><span class="pre">f</span></code> in <code class="docutils literal notranslate"><span class="pre">x_j</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.intervals">
<span class="sig-name descname"><span class="pre">intervals</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">all</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">eps</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">inf</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sup</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fast</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sqf</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L801-L816"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.intervals" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute isolating intervals for roots of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.invert">
<span class="sig-name descname"><span class="pre">invert</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L637-L644"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.invert" title="Permalink to this definition">¶</a></dt>
<dd><p>Invert <code class="docutils literal notranslate"><span class="pre">f</span></code> modulo <code class="docutils literal notranslate"><span class="pre">g</span></code>, if possible.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.is_cyclotomic">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_cyclotomic</span></span><a class="headerlink" href="#sympy.polys.polyclasses.DMP.is_cyclotomic" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">True</span></code> if <code class="docutils literal notranslate"><span class="pre">f</span></code> is a cyclotomic polynomial.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.is_ground">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_ground</span></span><a class="headerlink" href="#sympy.polys.polyclasses.DMP.is_ground" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">True</span></code> if <code class="docutils literal notranslate"><span class="pre">f</span></code> is an element of the ground domain.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.is_homogeneous">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_homogeneous</span></span><a class="headerlink" href="#sympy.polys.polyclasses.DMP.is_homogeneous" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">True</span></code> if <code class="docutils literal notranslate"><span class="pre">f</span></code> is a homogeneous polynomial.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.is_irreducible">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_irreducible</span></span><a class="headerlink" href="#sympy.polys.polyclasses.DMP.is_irreducible" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">True</span></code> if <code class="docutils literal notranslate"><span class="pre">f</span></code> has no factors over its domain.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.is_linear">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_linear</span></span><a class="headerlink" href="#sympy.polys.polyclasses.DMP.is_linear" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">True</span></code> if <code class="docutils literal notranslate"><span class="pre">f</span></code> is linear in all its variables.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.is_monic">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_monic</span></span><a class="headerlink" href="#sympy.polys.polyclasses.DMP.is_monic" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">True</span></code> if the leading coefficient of <code class="docutils literal notranslate"><span class="pre">f</span></code> is one.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.is_monomial">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_monomial</span></span><a class="headerlink" href="#sympy.polys.polyclasses.DMP.is_monomial" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">True</span></code> if <code class="docutils literal notranslate"><span class="pre">f</span></code> is zero or has only one term.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.is_one">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_one</span></span><a class="headerlink" href="#sympy.polys.polyclasses.DMP.is_one" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">True</span></code> if <code class="docutils literal notranslate"><span class="pre">f</span></code> is a unit polynomial.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.is_primitive">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_primitive</span></span><a class="headerlink" href="#sympy.polys.polyclasses.DMP.is_primitive" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">True</span></code> if the GCD of the coefficients of <code class="docutils literal notranslate"><span class="pre">f</span></code> is one.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.is_quadratic">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_quadratic</span></span><a class="headerlink" href="#sympy.polys.polyclasses.DMP.is_quadratic" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">True</span></code> if <code class="docutils literal notranslate"><span class="pre">f</span></code> is quadratic in all its variables.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.is_sqf">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_sqf</span></span><a class="headerlink" href="#sympy.polys.polyclasses.DMP.is_sqf" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">True</span></code> if <code class="docutils literal notranslate"><span class="pre">f</span></code> is a square-free polynomial.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.is_zero">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_zero</span></span><a class="headerlink" href="#sympy.polys.polyclasses.DMP.is_zero" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">True</span></code> if <code class="docutils literal notranslate"><span class="pre">f</span></code> is a zero polynomial.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.l1_norm">
<span class="sig-name descname"><span class="pre">l1_norm</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L580-L582"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.l1_norm" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns l1 norm of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.lcm">
<span class="sig-name descname"><span class="pre">lcm</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L682-L685"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.lcm" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns polynomial LCM of <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.lift">
<span class="sig-name descname"><span class="pre">lift</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L349-L351"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.lift" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert algebraic coefficients to rationals.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.max_norm">
<span class="sig-name descname"><span class="pre">max_norm</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L576-L578"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.max_norm" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns maximum norm of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.monic">
<span class="sig-name descname"><span class="pre">monic</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L707-L709"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.monic" title="Permalink to this definition">¶</a></dt>
<dd><p>Divides all coefficients by <code class="docutils literal notranslate"><span class="pre">LC(f)</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.monoms">
<span class="sig-name descname"><span class="pre">monoms</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L307-L309"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.monoms" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns all non-zero monomials from <code class="docutils literal notranslate"><span class="pre">f</span></code> in lex order.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.mul">
<span class="sig-name descname"><span class="pre">mul</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L449-L452"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.mul" title="Permalink to this definition">¶</a></dt>
<dd><p>Multiply two multivariate polynomials <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.mul_ground">
<span class="sig-name descname"><span class="pre">mul_ground</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">c</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L419-L421"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.mul_ground" title="Permalink to this definition">¶</a></dt>
<dd><p>Multiply <code class="docutils literal notranslate"><span class="pre">f</span></code> by a an element of the ground domain.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.neg">
<span class="sig-name descname"><span class="pre">neg</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L435-L437"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.neg" title="Permalink to this definition">¶</a></dt>
<dd><p>Negate all coefficients in <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.norm">
<span class="sig-name descname"><span class="pre">norm</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L767-L770"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.norm" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes <code class="docutils literal notranslate"><span class="pre">Norm(f)</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.nth">
<span class="sig-name descname"><span class="pre">nth</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">N</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L569-L574"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.nth" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the <code class="docutils literal notranslate"><span class="pre">n</span></code>-th coefficient of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.pdiv">
<span class="sig-name descname"><span class="pre">pdiv</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L465-L469"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.pdiv" title="Permalink to this definition">¶</a></dt>
<dd><p>Polynomial pseudo-division of <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.per">
<span class="sig-name descname"><span class="pre">per</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rep</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dom</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">kill</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ring</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L197-L213"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.per" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a DMP out of the given representation.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.permute">
<span class="sig-name descname"><span class="pre">permute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">P</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L387-L404"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.permute" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a polynomial in <span class="math notranslate nohighlight">\(K[x_{P(1)}, ..., x_{P(n)}]\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.polyclasses</span> <span class="kn">import</span> <span class="n">DMP</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.domains</span> <span class="kn">import</span> <span class="n">ZZ</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DMP</span><span class="p">([[[</span><span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">)],</span> <span class="p">[</span><span class="n">ZZ</span><span class="p">(</span><span class="mi">1</span><span class="p">),</span> <span class="n">ZZ</span><span class="p">(</span><span class="mi">0</span><span class="p">)]],</span> <span class="p">[[]]],</span> <span class="n">ZZ</span><span class="p">)</span><span class="o">.</span><span class="n">permute</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">])</span>
<span class="go">DMP([[[2], []], [[1, 0], []]], ZZ, None)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DMP</span><span class="p">([[[</span><span class="n">ZZ</span><span class="p">(</span><span class="mi">2</span><span class="p">)],</span> <span class="p">[</span><span class="n">ZZ</span><span class="p">(</span><span class="mi">1</span><span class="p">),</span> <span class="n">ZZ</span><span class="p">(</span><span class="mi">0</span><span class="p">)]],</span> <span class="p">[[]]],</span> <span class="n">ZZ</span><span class="p">)</span><span class="o">.</span><span class="n">permute</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">0</span><span class="p">])</span>
<span class="go">DMP([[[1], []], [[2, 0], []]], ZZ, None)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.pexquo">
<span class="sig-name descname"><span class="pre">pexquo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L481-L484"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.pexquo" title="Permalink to this definition">¶</a></dt>
<dd><p>Polynomial exact pseudo-quotient of <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.pow">
<span class="sig-name descname"><span class="pre">pow</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L458-L463"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.pow" title="Permalink to this definition">¶</a></dt>
<dd><p>Raise <code class="docutils literal notranslate"><span class="pre">f</span></code> to a non-negative power <code class="docutils literal notranslate"><span class="pre">n</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.pquo">
<span class="sig-name descname"><span class="pre">pquo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L476-L479"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.pquo" title="Permalink to this definition">¶</a></dt>
<dd><p>Polynomial pseudo-quotient of <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.prem">
<span class="sig-name descname"><span class="pre">prem</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L471-L474"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.prem" title="Permalink to this definition">¶</a></dt>
<dd><p>Polynomial pseudo-remainder of <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.primitive">
<span class="sig-name descname"><span class="pre">primitive</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L715-L718"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.primitive" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns content and a primitive form of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.quo">
<span class="sig-name descname"><span class="pre">quo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L497-L500"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.quo" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes polynomial quotient of <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.quo_ground">
<span class="sig-name descname"><span class="pre">quo_ground</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">c</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L423-L425"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.quo_ground" title="Permalink to this definition">¶</a></dt>
<dd><p>Quotient of <code class="docutils literal notranslate"><span class="pre">f</span></code> by a an element of the ground domain.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.refine_root">
<span class="sig-name descname"><span class="pre">refine_root</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">s</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">t</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">eps</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">steps</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fast</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L818-L829"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.refine_root" title="Permalink to this definition">¶</a></dt>
<dd><p>Refine an isolating interval to the given precision.</p>
<p><code class="docutils literal notranslate"><span class="pre">eps</span></code> should be a rational number.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.rem">
<span class="sig-name descname"><span class="pre">rem</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L492-L495"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.rem" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes polynomial remainder of <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.resultant">
<span class="sig-name descname"><span class="pre">resultant</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">includePRS</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L659-L665"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.resultant" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes resultant of <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code> via PRS.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.revert">
<span class="sig-name descname"><span class="pre">revert</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L646-L651"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.revert" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute <code class="docutils literal notranslate"><span class="pre">f**(-1)</span></code> mod <code class="docutils literal notranslate"><span class="pre">x**n</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.shift">
<span class="sig-name descname"><span class="pre">shift</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L732-L737"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.shift" title="Permalink to this definition">¶</a></dt>
<dd><p>Efficiently compute Taylor shift <code class="docutils literal notranslate"><span class="pre">f(x</span> <span class="pre">+</span> <span class="pre">a)</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.slice">
<span class="sig-name descname"><span class="pre">slice</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">j</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L299-L301"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.slice" title="Permalink to this definition">¶</a></dt>
<dd><p>Take a continuous subsequence of terms of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.sqf_list">
<span class="sig-name descname"><span class="pre">sqf_list</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">all</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L781-L784"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.sqf_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of square-free factors of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.sqf_list_include">
<span class="sig-name descname"><span class="pre">sqf_list_include</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">all</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L786-L789"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.sqf_list_include" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of square-free factors of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.sqf_norm">
<span class="sig-name descname"><span class="pre">sqf_norm</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L772-L775"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.sqf_norm" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes square-free norm of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.sqf_part">
<span class="sig-name descname"><span class="pre">sqf_part</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L777-L779"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.sqf_part" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes square-free part of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.sqr">
<span class="sig-name descname"><span class="pre">sqr</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L454-L456"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.sqr" title="Permalink to this definition">¶</a></dt>
<dd><p>Square a multivariate polynomial <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.sturm">
<span class="sig-name descname"><span class="pre">sturm</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L753-L758"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.sturm" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes the Sturm sequence of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.sub">
<span class="sig-name descname"><span class="pre">sub</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L444-L447"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.sub" title="Permalink to this definition">¶</a></dt>
<dd><p>Subtract two multivariate polynomials <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.sub_ground">
<span class="sig-name descname"><span class="pre">sub_ground</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">c</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L415-L417"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.sub_ground" title="Permalink to this definition">¶</a></dt>
<dd><p>Subtract an element of the ground domain from <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.subresultants">
<span class="sig-name descname"><span class="pre">subresultants</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L653-L657"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.subresultants" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes subresultant PRS sequence of <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.terms">
<span class="sig-name descname"><span class="pre">terms</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L311-L313"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.terms" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns all non-zero terms from <code class="docutils literal notranslate"><span class="pre">f</span></code> in lex order.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.terms_gcd">
<span class="sig-name descname"><span class="pre">terms_gcd</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L406-L409"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.terms_gcd" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove GCD of terms from the polynomial <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.to_dict">
<span class="sig-name descname"><span class="pre">to_dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">zero</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L233-L235"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.to_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">f</span></code> to a dict representation with native coefficients.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.to_exact">
<span class="sig-name descname"><span class="pre">to_exact</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L288-L290"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.to_exact" title="Permalink to this definition">¶</a></dt>
<dd><p>Make the ground domain exact.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.to_field">
<span class="sig-name descname"><span class="pre">to_field</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L284-L286"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.to_field" title="Permalink to this definition">¶</a></dt>
<dd><p>Make the ground domain a field.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.to_list">
<span class="sig-name descname"><span class="pre">to_list</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L246-L248"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.to_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">f</span></code> to a list representation with native coefficients.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.to_ring">
<span class="sig-name descname"><span class="pre">to_ring</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L280-L282"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.to_ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Make the ground domain a ring.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.to_sympy_dict">
<span class="sig-name descname"><span class="pre">to_sympy_dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">zero</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L237-L244"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.to_sympy_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">f</span></code> to a dict representation with SymPy coefficients.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.to_sympy_list">
<span class="sig-name descname"><span class="pre">to_sympy_list</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L250-L261"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.to_sympy_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">f</span></code> to a list representation with SymPy coefficients.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.to_tuple">
<span class="sig-name descname"><span class="pre">to_tuple</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L263-L269"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.to_tuple" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">f</span></code> to a tuple representation with native coefficients.</p>
<p>This is needed for hashing.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.total_degree">
<span class="sig-name descname"><span class="pre">total_degree</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L522-L524"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.total_degree" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the total degree of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.transform">
<span class="sig-name descname"><span class="pre">transform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">q</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L739-L751"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Evaluate functional transformation <code class="docutils literal notranslate"><span class="pre">q**n</span> <span class="pre">*</span> <span class="pre">f(p/q)</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.trunc">
<span class="sig-name descname"><span class="pre">trunc</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L703-L705"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.trunc" title="Permalink to this definition">¶</a></dt>
<dd><p>Reduce <code class="docutils literal notranslate"><span class="pre">f</span></code> modulo a constant <code class="docutils literal notranslate"><span class="pre">p</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMP.unify">
<span class="sig-name descname"><span class="pre">unify</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L167-L195"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMP.unify" title="Permalink to this definition">¶</a></dt>
<dd><p>Unify representations of two multivariate polynomials.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMF">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.polyclasses.</span></span><span class="sig-name descname"><span class="pre">DMF</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rep</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dom</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lev</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ring</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1060-L1497"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMF" title="Permalink to this definition">¶</a></dt>
<dd><p>Dense Multivariate Fractions over <span class="math notranslate nohighlight">\(K\)</span>.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMF.add">
<span class="sig-name descname"><span class="pre">add</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1267-L1280"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMF.add" title="Permalink to this definition">¶</a></dt>
<dd><p>Add two multivariate fractions <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMF.cancel">
<span class="sig-name descname"><span class="pre">cancel</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1259-L1261"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMF.cancel" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove common factors from <code class="docutils literal notranslate"><span class="pre">f.num</span></code> and <code class="docutils literal notranslate"><span class="pre">f.den</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMF.denom">
<span class="sig-name descname"><span class="pre">denom</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1255-L1257"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMF.denom" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the denominator of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMF.exquo">
<span class="sig-name descname"><span class="pre">exquo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1322-L1338"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMF.exquo" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes quotient of fractions <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMF.frac_unify">
<span class="sig-name descname"><span class="pre">frac_unify</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1176-L1211"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMF.frac_unify" title="Permalink to this definition">¶</a></dt>
<dd><p>Unify representations of two multivariate fractions.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMF.half_per">
<span class="sig-name descname"><span class="pre">half_per</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rep</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">kill</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1231-L1241"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMF.half_per" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a DMP out of the given representation.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMF.invert">
<span class="sig-name descname"><span class="pre">invert</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">check</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1342-L1347"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMF.invert" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes inverse of a fraction <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMF.is_one">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_one</span></span><a class="headerlink" href="#sympy.polys.polyclasses.DMF.is_one" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">True</span></code> if <code class="docutils literal notranslate"><span class="pre">f</span></code> is a unit fraction.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMF.is_zero">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_zero</span></span><a class="headerlink" href="#sympy.polys.polyclasses.DMF.is_zero" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">True</span></code> if <code class="docutils literal notranslate"><span class="pre">f</span></code> is a zero fraction.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMF.mul">
<span class="sig-name descname"><span class="pre">mul</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1297-L1309"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMF.mul" title="Permalink to this definition">¶</a></dt>
<dd><p>Multiply two multivariate fractions <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMF.neg">
<span class="sig-name descname"><span class="pre">neg</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1263-L1265"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMF.neg" title="Permalink to this definition">¶</a></dt>
<dd><p>Negate all coefficients in <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMF.numer">
<span class="sig-name descname"><span class="pre">numer</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1251-L1253"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMF.numer" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the numerator of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMF.per">
<span class="sig-name descname"><span class="pre">per</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">num</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">den</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cancel</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">kill</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ring</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1213-L1229"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMF.per" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a DMF out of the given representation.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMF.poly_unify">
<span class="sig-name descname"><span class="pre">poly_unify</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1141-L1174"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMF.poly_unify" title="Permalink to this definition">¶</a></dt>
<dd><p>Unify a multivariate fraction and a polynomial.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMF.pow">
<span class="sig-name descname"><span class="pre">pow</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1311-L1320"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMF.pow" title="Permalink to this definition">¶</a></dt>
<dd><p>Raise <code class="docutils literal notranslate"><span class="pre">f</span></code> to a non-negative power <code class="docutils literal notranslate"><span class="pre">n</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMF.quo">
<span class="sig-name descname"><span class="pre">quo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1322-L1338"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMF.quo" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes quotient of fractions <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.DMF.sub">
<span class="sig-name descname"><span class="pre">sub</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1282-L1295"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.DMF.sub" title="Permalink to this definition">¶</a></dt>
<dd><p>Subtract two multivariate fractions <code class="docutils literal notranslate"><span class="pre">f</span></code> and <code class="docutils literal notranslate"><span class="pre">g</span></code>.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.ANP">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.polyclasses.</span></span><span class="sig-name descname"><span class="pre">ANP</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rep</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mod</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dom</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1505-L1767"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.ANP" title="Permalink to this definition">¶</a></dt>
<dd><p>Dense Algebraic Number Polynomials over a field.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.ANP.LC">
<span class="sig-name descname"><span class="pre">LC</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1651-L1653"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.ANP.LC" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the leading coefficient of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.ANP.TC">
<span class="sig-name descname"><span class="pre">TC</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1655-L1657"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.ANP.TC" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the trailing coefficient of <code class="docutils literal notranslate"><span class="pre">f</span></code>.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.ANP.is_ground">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_ground</span></span><a class="headerlink" href="#sympy.polys.polyclasses.ANP.is_ground" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">True</span></code> if <code class="docutils literal notranslate"><span class="pre">f</span></code> is an element of the ground domain.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.ANP.is_one">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_one</span></span><a class="headerlink" href="#sympy.polys.polyclasses.ANP.is_one" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">True</span></code> if <code class="docutils literal notranslate"><span class="pre">f</span></code> is a unit algebraic number.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.ANP.is_zero">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_zero</span></span><a class="headerlink" href="#sympy.polys.polyclasses.ANP.is_zero" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">True</span></code> if <code class="docutils literal notranslate"><span class="pre">f</span></code> is a zero algebraic number.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.ANP.pow">
<span class="sig-name descname"><span class="pre">pow</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1619-L1629"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.ANP.pow" title="Permalink to this definition">¶</a></dt>
<dd><p>Raise <code class="docutils literal notranslate"><span class="pre">f</span></code> to a non-negative power <code class="docutils literal notranslate"><span class="pre">n</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.ANP.to_dict">
<span class="sig-name descname"><span class="pre">to_dict</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1571-L1573"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.ANP.to_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">f</span></code> to a dict representation with native coefficients.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.ANP.to_list">
<span class="sig-name descname"><span class="pre">to_list</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1584-L1586"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.ANP.to_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">f</span></code> to a list representation with native coefficients.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.ANP.to_sympy_dict">
<span class="sig-name descname"><span class="pre">to_sympy_dict</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1575-L1582"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.ANP.to_sympy_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">f</span></code> to a dict representation with SymPy coefficients.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.ANP.to_sympy_list">
<span class="sig-name descname"><span class="pre">to_sympy_list</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1588-L1590"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.ANP.to_sympy_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">f</span></code> to a list representation with SymPy coefficients.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.ANP.to_tuple">
<span class="sig-name descname"><span class="pre">to_tuple</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1592-L1598"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.ANP.to_tuple" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">f</span></code> to a tuple representation with native coefficients.</p>
<p>This is needed for hashing.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.polyclasses.ANP.unify">
<span class="sig-name descname"><span class="pre">unify</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">g</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/polyclasses.py#L1535-L1558"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.polyclasses.ANP.unify" title="Permalink to this definition">¶</a></dt>
<dd><p>Unify representations of two algebraic numbers.</p>
</dd></dl>

</dd></dl>

</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../index.html">
              <img class="logo" src="../../_static/sympylogo.png" alt="Logo"/>
            </a></p>
  <h3><a href="../../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Reference docs for the Poly Domains</a><ul>
<li><a class="reference internal" href="#domains">Domains</a></li>
<li><a class="reference internal" href="#abstract-domains">Abstract Domains</a></li>
<li><a class="reference internal" href="#gf-p">GF(p)</a></li>
<li><a class="reference internal" href="#zz">ZZ</a></li>
<li><a class="reference internal" href="#qq">QQ</a></li>
<li><a class="reference internal" href="#mpq">MPQ</a></li>
<li><a class="reference internal" href="#gaussian-domains">Gaussian domains</a></li>
<li><a class="reference internal" href="#zz-i">ZZ_I</a></li>
<li><a class="reference internal" href="#qq-i">QQ_I</a></li>
<li><a class="reference internal" href="#qq-a">QQ&lt;a&gt;</a></li>
<li><a class="reference internal" href="#rr">RR</a></li>
<li><a class="reference internal" href="#cc">CC</a></li>
<li><a class="reference internal" href="#k-x">K[x]</a></li>
<li><a class="reference internal" href="#id11">K(x)</a></li>
<li><a class="reference internal" href="#ex">EX</a></li>
<li><a class="reference internal" href="#quotient-ring">Quotient ring</a></li>
<li><a class="reference internal" href="#sparse-polynomials">Sparse polynomials</a></li>
<li><a class="reference internal" href="#sparse-rational-functions">Sparse rational functions</a></li>
<li><a class="reference internal" href="#dense-polynomials">Dense polynomials</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="domainsintro.html"
                        title="previous chapter">Introducing the Domains of the poly module</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="internals.html"
                        title="next chapter">Internals of the Polynomial Manipulation Module</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../_sources/modules/polys/domainsref.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="https://docs.sympy.org/latest/search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="internals.html" title="Internals of the Polynomial Manipulation Module"
             >next</a> |</li>
        <li class="right" >
          <a href="domainsintro.html" title="Introducing the Domains of the poly module"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" >Polynomial Manipulation</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Reference docs for the Poly Domains</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2021 SymPy Development Team.
      Last updated on Sep 30, 2021.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2.
    </div>
  </body>

<!-- Mirrored from docs.sympy.org/latest/modules/polys/domainsref.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:29:05 GMT -->
</html>